mirror of git://git.suckless.org/ubase
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:
parent
ee88227c33
commit
d06158ccf9
4
umount.c
4
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;
|
||||
|
|
Loading…
Reference in New Issue