summaryrefslogtreecommitdiff
path: root/umount.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-13 04:07:02 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-13 04:07:02 +0000
commitce91732416d3fb68ebf527ec839e8f810ea65ebd (patch)
tree23f70e6e90faa8e7f8aac7d336fe88bbf646efeb /umount.c
parent3522eb1ab3a4f1bcbf2c0f0eed387733b29c9e95 (diff)
downloadbusybox-w32-ce91732416d3fb68ebf527ec839e8f810ea65ebd.tar.gz
busybox-w32-ce91732416d3fb68ebf527ec839e8f810ea65ebd.tar.bz2
busybox-w32-ce91732416d3fb68ebf527ec839e8f810ea65ebd.zip
Some bug fixes I forgot to check-in the other day.
Mounting loop devices w/o specifying the filesystem type choked if it didn't guess right the first time. -Erik
Diffstat (limited to 'umount.c')
-rw-r--r--umount.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/umount.c b/umount.c
index 0f087e197..b0f393cca 100644
--- a/umount.c
+++ b/umount.c
@@ -41,6 +41,9 @@ static const char umount_usage[] =
41#ifdef BB_FEATURE_REMOUNT 41#ifdef BB_FEATURE_REMOUNT
42 "\t-r:\tTry to remount devices as read-only if mount is busy\n" 42 "\t-r:\tTry to remount devices as read-only if mount is busy\n"
43#endif 43#endif
44#if defined BB_FEATURE_MOUNT_LOOP
45 "\t-f:\tDo not free loop device (if a loop device has been used)\n"
46#endif
44; 47;
45 48
46struct _mtab_entry_t { 49struct _mtab_entry_t {
@@ -53,9 +56,14 @@ static struct _mtab_entry_t *mtab_cache = NULL;
53 56
54 57
55 58
59#if defined BB_FEATURE_MOUNT_LOOP
60static int freeLoop = TRUE;
61#endif
56static int useMtab = TRUE; 62static int useMtab = TRUE;
57static int umountAll = FALSE; 63static int umountAll = FALSE;
64#if defined BB_FEATURE_REMOUNT
58static int doRemount = FALSE; 65static int doRemount = FALSE;
66#endif
59extern const char mtab_file[]; /* Defined in utility.c */ 67extern const char mtab_file[]; /* Defined in utility.c */
60 68
61 69
@@ -167,7 +175,7 @@ static int do_umount(const char *name, int useMtab)
167 status = umount(name); 175 status = umount(name);
168 176
169#if defined BB_FEATURE_MOUNT_LOOP 177#if defined BB_FEATURE_MOUNT_LOOP
170 if (blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9)) 178 if (freeLoop == TRUE && blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
171 /* this was a loop device, delete it */ 179 /* this was a loop device, delete it */
172 del_loop(blockDevice); 180 del_loop(blockDevice);
173#endif 181#endif
@@ -236,6 +244,11 @@ extern int umount_main(int argc, char **argv)
236 case 'a': 244 case 'a':
237 umountAll = TRUE; 245 umountAll = TRUE;
238 break; 246 break;
247#if defined BB_FEATURE_MOUNT_LOOP
248 case 'f':
249 freeLoop = FALSE;
250 break;
251#endif
239#ifdef BB_MTAB 252#ifdef BB_MTAB
240 case 'n': 253 case 'n':
241 useMtab = FALSE; 254 useMtab = FALSE;