Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/cmd/unmount.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
 
4
void
5
main(int argc, char *argv[])
6
{
7
	int r;
8
	char *mnted, *mtpt;
9
 
10
	argv0 = argv[0];
11
	switch (argc) {
12
	case 2:
13
		mnted = nil;
14
		mtpt = argv[1];
15
		break;
16
	case 3:
17
		mnted = argv[1];
18
		mtpt = argv[2];
19
		break;
20
	default:
21
		SET(mnted, mtpt);
22
		fprint(2, "usage: unmount mountpoint\n");
23
		fprint(2, "       unmount mounted mountpoint\n");
24
		exits("usage");
25
	}
26
 
27
	/* unmount takes arguments in the same order as mount */
28
	r = unmount(mnted, mtpt);
29
	if(r < 0)
30
		sysfatal("%s: %r", mtpt);
31
	exits(0);
32
}