* Fixed a bug where "sed 's/foo/bar/g'" (i.e. a script w/o a "-e")
* ps now supports BB_FEATURE_AUTOWIDTH, and can adjust its width
to match the terminal (defaults to width=79 when this is off).
+ * Fixed mount'ing loop devices when the filesystem type was not
+ specified. It used to revert to non-loop after the first try.
-Erik Andersen
fprintf(stderr, "WARNING: loop device is read-only\n");
flags &= ~MS_RDONLY;
}
- use_loop = FALSE;
}
#endif
status =
case 'a':
all = TRUE;
break;
-#ifdef BB_MTAB
case 'f':
fakeIt = TRUE;
break;
+#ifdef BB_MTAB
case 'n':
useMtab = FALSE;
break;
#ifdef BB_FEATURE_REMOUNT
"\t-r:\tTry to remount devices as read-only if mount is busy\n"
#endif
+#if defined BB_FEATURE_MOUNT_LOOP
+ "\t-f:\tDo not free loop device (if a loop device has been used)\n"
+#endif
;
struct _mtab_entry_t {
+#if defined BB_FEATURE_MOUNT_LOOP
+static int freeLoop = TRUE;
+#endif
static int useMtab = TRUE;
static int umountAll = FALSE;
+#if defined BB_FEATURE_REMOUNT
static int doRemount = FALSE;
+#endif
extern const char mtab_file[]; /* Defined in utility.c */
status = umount(name);
#if defined BB_FEATURE_MOUNT_LOOP
- if (blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
+ if (freeLoop == TRUE && blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
/* this was a loop device, delete it */
del_loop(blockDevice);
#endif
case 'a':
umountAll = TRUE;
break;
+#if defined BB_FEATURE_MOUNT_LOOP
+ case 'f':
+ freeLoop = FALSE;
+ break;
+#endif
#ifdef BB_MTAB
case 'n':
useMtab = FALSE;
fprintf(stderr, "WARNING: loop device is read-only\n");
flags &= ~MS_RDONLY;
}
- use_loop = FALSE;
}
#endif
status =
case 'a':
all = TRUE;
break;
-#ifdef BB_MTAB
case 'f':
fakeIt = TRUE;
break;
+#ifdef BB_MTAB
case 'n':
useMtab = FALSE;
break;
#ifdef BB_FEATURE_REMOUNT
"\t-r:\tTry to remount devices as read-only if mount is busy\n"
#endif
+#if defined BB_FEATURE_MOUNT_LOOP
+ "\t-f:\tDo not free loop device (if a loop device has been used)\n"
+#endif
;
struct _mtab_entry_t {
+#if defined BB_FEATURE_MOUNT_LOOP
+static int freeLoop = TRUE;
+#endif
static int useMtab = TRUE;
static int umountAll = FALSE;
+#if defined BB_FEATURE_REMOUNT
static int doRemount = FALSE;
+#endif
extern const char mtab_file[]; /* Defined in utility.c */
status = umount(name);
#if defined BB_FEATURE_MOUNT_LOOP
- if (blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
+ if (freeLoop == TRUE && blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
/* this was a loop device, delete it */
del_loop(blockDevice);
#endif
case 'a':
umountAll = TRUE;
break;
+#if defined BB_FEATURE_MOUNT_LOOP
+ case 'f':
+ freeLoop = FALSE;
+ break;
+#endif
#ifdef BB_MTAB
case 'n':
useMtab = FALSE;