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.
This commit is contained in:
sin 2014-03-18 16:26:33 +02:00
parent ee88227c33
commit d06158ccf9
1 changed files with 2 additions and 2 deletions

View File

@ -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;