commit d06158ccf9c06d143cef841d01167632031e19e8
parent ee88227c33bae40f5488c1d61969eed1e668186b
Author: sin <sin@2f30.org>
Date: Tue, 18 Mar 2014 16:26:33 +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.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/umount.c b/umount.c
@@ -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;