From d06158ccf9c06d143cef841d01167632031e19e8 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 18 Mar 2014 16:26:33 +0200 Subject: [PATCH] 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. --- umount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umount.c b/umount.c index 429ada1..3650709 100644 --- 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;