diff options
Diffstat (limited to 'util-linux/umount.c')
-rw-r--r-- | util-linux/umount.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/util-linux/umount.c b/util-linux/umount.c index 2868a1bc3..cc7d38d7c 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -57,7 +57,9 @@ static int doForce = FALSE; | |||
57 | #if defined BB_FEATURE_MOUNT_LOOP | 57 | #if defined BB_FEATURE_MOUNT_LOOP |
58 | static int freeLoop = TRUE; | 58 | static int freeLoop = TRUE; |
59 | #endif | 59 | #endif |
60 | #if defined BB_MTAB | ||
60 | static int useMtab = TRUE; | 61 | static int useMtab = TRUE; |
62 | #endif | ||
61 | static int umountAll = FALSE; | 63 | static int umountAll = FALSE; |
62 | static int doRemount = FALSE; | 64 | static int doRemount = FALSE; |
63 | extern const char mtab_file[]; /* Defined in utility.c */ | 65 | extern const char mtab_file[]; /* Defined in utility.c */ |
@@ -162,7 +164,7 @@ void mtab_free(void) | |||
162 | } | 164 | } |
163 | #endif | 165 | #endif |
164 | 166 | ||
165 | static int do_umount(const char *name, int useMtab) | 167 | static int do_umount(const char *name) |
166 | { | 168 | { |
167 | int status; | 169 | int status; |
168 | char *blockDevice = mtab_getinfo(name, MTAB_GETDEVICE); | 170 | char *blockDevice = mtab_getinfo(name, MTAB_GETDEVICE); |
@@ -204,7 +206,7 @@ static int do_umount(const char *name, int useMtab) | |||
204 | return (FALSE); | 206 | return (FALSE); |
205 | } | 207 | } |
206 | 208 | ||
207 | static int umount_all(int useMtab) | 209 | static int umount_all(void) |
208 | { | 210 | { |
209 | int status = TRUE; | 211 | int status = TRUE; |
210 | char *mountpt; | 212 | char *mountpt; |
@@ -214,14 +216,14 @@ static int umount_all(int useMtab) | |||
214 | /* Never umount /proc on a umount -a */ | 216 | /* Never umount /proc on a umount -a */ |
215 | if (strstr(mountpt, "proc")!= NULL) | 217 | if (strstr(mountpt, "proc")!= NULL) |
216 | continue; | 218 | continue; |
217 | if (!do_umount(mountpt, useMtab)) { | 219 | if (!do_umount(mountpt)) { |
218 | /* Don't bother retrying the umount on busy devices */ | 220 | /* Don't bother retrying the umount on busy devices */ |
219 | if (errno == EBUSY) { | 221 | if (errno == EBUSY) { |
220 | perror_msg("%s", mountpt); | 222 | perror_msg("%s", mountpt); |
221 | status = FALSE; | 223 | status = FALSE; |
222 | continue; | 224 | continue; |
223 | } | 225 | } |
224 | if (!do_umount(mountpt, useMtab)) { | 226 | if (!do_umount(mountpt)) { |
225 | printf("Couldn't umount %s on %s: %s\n", | 227 | printf("Couldn't umount %s on %s: %s\n", |
226 | mountpt, mtab_getinfo(mountpt, MTAB_GETDEVICE), | 228 | mountpt, mtab_getinfo(mountpt, MTAB_GETDEVICE), |
227 | strerror(errno)); | 229 | strerror(errno)); |
@@ -275,12 +277,12 @@ extern int umount_main(int argc, char **argv) | |||
275 | 277 | ||
276 | mtab_read(); | 278 | mtab_read(); |
277 | if (umountAll == TRUE) { | 279 | if (umountAll == TRUE) { |
278 | if (umount_all(useMtab) == TRUE) | 280 | if (umount_all() == TRUE) |
279 | return EXIT_SUCCESS; | 281 | return EXIT_SUCCESS; |
280 | else | 282 | else |
281 | return EXIT_FAILURE; | 283 | return EXIT_FAILURE; |
282 | } | 284 | } |
283 | if (do_umount(*argv, useMtab) == TRUE) | 285 | if (do_umount(*argv) == TRUE) |
284 | return EXIT_SUCCESS; | 286 | return EXIT_SUCCESS; |
285 | perror_msg_and_die("%s", *argv); | 287 | perror_msg_and_die("%s", *argv); |
286 | } | 288 | } |