commit 43d55a3dfad24a52d629d835d93d65b14a43cb5a
parent 636072c55e24410ef4683518870aec7248d3c5f0
Author: qorg11 <qorg@vxempire.xyz>
Date: Wed, 8 Jul 2020 11:09:33 +0200
-f flag for umount.c (now we use umount2 though)
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/umount.c b/src/umount.c
@@ -1,16 +1,25 @@
#include <stdio.h>
#include <sys/mount.h>
#include <errno.h>
+#include <getopt.h>
int
main(int argc, char *argv[])
{
+ int c = getopt(argc, argv, "f");
+ int options = 0; /* No options by default */
+ int destination = 1;
+ if(c == 'f')
+ {
+ options = MNT_FORCE;
+ destination++;
+ }
if(argc == 1)
{
printf("give a directory\n");
return 1;
}
- int fd = umount(argv[1]);
+ int fd = umount2(argv[destination],options);
if(fd == -1)
{
printf("error umounting: %i\n",errno);