diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-03-04 17:28:43 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-03-04 17:28:43 -0500 |
commit | 85caf29cfd2f40ef10ed76d425bb89a5f8f45a1a (patch) | |
tree | 04b92c8e68340547a38010b427d678475b382187 /mtab.c | |
parent | 75ad5815156efe50e6a94be3c98a058d93717a89 (diff) | |
download | bfs-85caf29cfd2f40ef10ed76d425bb89a5f8f45a1a.tar.xz |
mtab: Fall back on /proc/mounts if /etc/mtab isn't available
Diffstat (limited to 'mtab.c')
-rw-r--r-- | mtab.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -99,6 +99,10 @@ struct bfs_mtab *parse_bfs_mtab() { FILE *file = setmntent(_PATH_MOUNTED, "r"); if (!file) { + // In case we're in a chroot or something with /proc but no /etc/mtab + file = setmntent("/proc/mounts", "r"); + } + if (!file) { goto fail; } |