[hackers] [ubase] Use /proc/mounts instead of /etc/mtab || sin

From: <git_AT_suckless.org>
Date: Tue, 18 Mar 2014 15:29:18 +0100

commit d06158ccf9c06d143cef841d01167632031e19e8
Author: sin <sin_AT_2f30.org>
Date: Tue Mar 18 16:26:33 2014 +0200

    Use /proc/mounts instead of /etc/mtab
    
    Let the kernel keep track of mounted filesystems, no need to use
    /etc/mtab as we are not modifying it.

diff --git a/umount.c b/umount.c
index 429ada1..3650709 100644
--- a/umount.c
+++ b/umount.c
_AT_@ -64,9 +64,9 @@ umountall(int flags)
         char **mntdirs = NULL;
         int len = 0;
 
- fp = setmntent("/etc/mtab", "r");
+ fp = setmntent("/proc/mounts", "r");
         if (!fp)
- eprintf("setmntent %s:", "/etc/mtab");
+ eprintf("setmntent %s:", "/proc/mounts");
         while ((me = getmntent(fp))) {
                 if (strcmp(me->mnt_type, "proc") == 0)
                         continue;
Received on Tue Mar 18 2014 - 15:29:18 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 18 2014 - 15:36:19 CET