2013-08-07 06:41:42 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
2013-08-07 04:52:10 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "ubase.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
2013-08-07 05:33:19 -04:00
|
|
|
eprintf("usage: %s [-lf] target\n", argv0);
|
2013-08-07 04:52:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[]) {
|
|
|
|
int i;
|
2013-08-07 05:33:19 -04:00
|
|
|
int flags = 0;
|
2013-08-07 04:52:10 -04:00
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
ARGBEGIN {
|
|
|
|
case 'f':
|
2013-08-07 05:33:19 -04:00
|
|
|
flags |= UBASE_MNT_FORCE;
|
|
|
|
break;
|
|
|
|
case 'l':
|
|
|
|
flags |= UBASE_MNT_DETACH;
|
2013-08-07 04:52:10 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
} ARGEND;
|
2013-08-10 06:38:30 -04:00
|
|
|
|
2013-08-07 04:52:10 -04:00
|
|
|
if (argc < 1)
|
|
|
|
usage();
|
2013-08-10 06:38:30 -04:00
|
|
|
|
2013-08-07 04:52:10 -04:00
|
|
|
for (i = 0; i < argc; i++) {
|
2013-08-07 05:33:19 -04:00
|
|
|
if (do_umount(argv[i], flags) < 0)
|
2013-08-07 04:52:10 -04:00
|
|
|
eprintf("do_umount:");
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|