Skip to content

Commit

Permalink
umount: instead of non-standard -D, use -d with opposite meaning
Browse files Browse the repository at this point in the history
This has been in upstream busybox for quite sometime, 2008-02-14 12:00:21 (GMT)
And has no negative effects on android devices.
Please see original commit:
http://git.busybox.net/busybox/commit/util-linux/umount.c?id=b2e578a1f2c3cf317b391a7d2c059d6a5f5368b8&ss=1

Change-Id: I7f8b9a6a88571b8190ffeaec75973f4ddf4f849e
  • Loading branch information
Denis Vlasenko authored and tpruvot committed Jul 16, 2012
1 parent a774532 commit 5d7c439
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util-linux/umount.c
Expand Up @@ -22,7 +22,7 @@
//usage: "\n -l Lazy umount (detach filesystem)"
//usage: "\n -f Force umount (i.e., unreachable NFS server)"
//usage: IF_FEATURE_MOUNT_LOOP(
//usage: "\n -D Don't free loop device even if it has been used"
//usage: "\n -d Free loop device even if it has been used"
//usage: )
//usage:
//usage:#define umount_example_usage
Expand Down Expand Up @@ -55,8 +55,8 @@ static struct mntent *getmntent_r(FILE* stream, struct mntent* result,
#define OPTION_STRING "fldDnra" "vt:i"
#define OPT_FORCE (1 << 0) // Same as MNT_FORCE
#define OPT_LAZY (1 << 1) // Same as MNT_DETACH
//#define OPT_FREE_LOOP (1 << 2) // -d is assumed always present
#define OPT_DONT_FREE_LOOP (1 << 3)
#define OPT_FREELOOP (1 << 2)
//#define OPT_DONT_FREE_LOOP (1 << 3) // Default behavior
#define OPT_NO_MTAB (1 << 4)
#define OPT_REMOUNT (1 << 5)
#define OPT_ALL (ENABLE_FEATURE_UMOUNT_ALL ? (1 << 6) : 0)
Expand Down Expand Up @@ -173,7 +173,7 @@ int umount_main(int argc UNUSED_PARAM, char **argv)
} else {
// De-allocate the loop device. This ioctl should be ignored on
// any non-loop block devices.
if (ENABLE_FEATURE_MOUNT_LOOP && !(opt & OPT_DONT_FREE_LOOP) && m)
if (ENABLE_FEATURE_MOUNT_LOOP && (opt & OPT_FREELOOP) && m)
del_loop(m->device);
if (ENABLE_FEATURE_MTAB_SUPPORT && !(opt & OPT_NO_MTAB) && m)
erase_mtab(m->dir);
Expand Down

0 comments on commit 5d7c439

Please sign in to comment.