aboutsummaryrefslogtreecommitdiff
path: root/mtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'mtab.c')
-rw-r--r--mtab.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/mtab.c b/mtab.c
index ab805e9c1..33b11c83e 100644
--- a/mtab.c
+++ b/mtab.c
@@ -21,12 +21,8 @@ void erase_mtab(const char *name)
21 21
22 /* Check if reading the mtab file failed */ 22 /* Check if reading the mtab file failed */
23 if (mountTable == 0 23 if (mountTable == 0
24#if ! defined BB_FEATURE_USE_PROCFS 24 /* Bummer. fall back on trying the /proc filesystem */
25 ) { 25 && (mountTable = setmntent("/proc/mounts", "r")) == 0) {
26#else
27 /* Bummer. fall back on trying the /proc filesystem */
28 && (mountTable = setmntent("/proc/mounts", "r")) == 0) {
29#endif
30 perror_msg("%s", mtab_file); 26 perror_msg("%s", mtab_file);
31 return; 27 return;
32 } 28 }
@@ -74,14 +70,12 @@ void write_mtab(char *blockDevice, char *directory,
74 if (length > 1 && directory[length - 1] == '/') 70 if (length > 1 && directory[length - 1] == '/')
75 directory[length - 1] = '\0'; 71 directory[length - 1] = '\0';
76 72
77#ifdef BB_FEATURE_USE_PROCFS
78 if (filesystemType == 0) { 73 if (filesystemType == 0) {
79 struct mntent *p = find_mount_point(blockDevice, "/proc/mounts"); 74 struct mntent *p = find_mount_point(blockDevice, "/proc/mounts");
80 75
81 if (p && p->mnt_type) 76 if (p && p->mnt_type)
82 filesystemType = p->mnt_type; 77 filesystemType = p->mnt_type;
83 } 78 }
84#endif
85 m.mnt_fsname = blockDevice; 79 m.mnt_fsname = blockDevice;
86 m.mnt_dir = directory; 80 m.mnt_dir = directory;
87 m.mnt_type = filesystemType ? filesystemType : "default"; 81 m.mnt_type = filesystemType ? filesystemType : "default";