[hackers] [ubase] Don't umount proc in umount -a || sin

From: <git_AT_suckless.org>
Date: Wed, 12 Mar 2014 15:40:08 +0100

commit 14716af4723e94913dfaf4516b975db1a764b5e8
Author: sin <sin_AT_2f30.org>
Date: Wed Mar 12 16:35:20 2014 +0200

    Don't umount proc in umount -a

diff --git a/umount.c b/umount.c
index d04410a..46143c1 100644
--- a/umount.c
+++ b/umount.c
_AT_@ -2,6 +2,7 @@
 #include <mntent.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/mount.h>
 #include "util.h"
 
_AT_@ -47,6 +48,8 @@ main(int argc, char *argv[])
                 if (!fp)
                         eprintf("setmntent %s:", "/etc/mtab");
                 while ((me = getmntent(fp))) {
+ if (strcmp(me->mnt_type, "proc") == 0)
+ continue;
                         if (umount2(me->mnt_dir, flags) < 0) {
                                 weprintf("umount2:");
                                 ret = EXIT_FAILURE;
Received on Wed Mar 12 2014 - 15:40:08 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 12 2014 - 15:48:29 CET