mirror of
git://git.suckless.org/ubase
synced 2025-02-18 11:37:01 +00:00
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;
|
char **mntdirs = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
fp = setmntent("/etc/mtab", "r");
|
fp = setmntent("/proc/mounts", "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
eprintf("setmntent %s:", "/etc/mtab");
|
eprintf("setmntent %s:", "/proc/mounts");
|
||||||
while ((me = getmntent(fp))) {
|
while ((me = getmntent(fp))) {
|
||||||
if (strcmp(me->mnt_type, "proc") == 0)
|
if (strcmp(me->mnt_type, "proc") == 0)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user