Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/util-linux/umount.c

    r2725 r3232  
    88 * Licensed under GPLv2, see file LICENSE in this source tree.
    99 */
     10
     11//usage:#define umount_trivial_usage
     12//usage:       "[OPTIONS] FILESYSTEM|DIRECTORY"
     13//usage:#define umount_full_usage "\n\n"
     14//usage:       "Unmount file systems\n"
     15//usage:    IF_FEATURE_UMOUNT_ALL(
     16//usage:     "\n    -a  Unmount all file systems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab")
     17//usage:    )
     18//usage:    IF_FEATURE_MTAB_SUPPORT(
     19//usage:     "\n    -n  Don't erase /etc/mtab entries"
     20//usage:    )
     21//usage:     "\n    -r  Try to remount devices as read-only if mount is busy"
     22//usage:     "\n    -l  Lazy umount (detach filesystem)"
     23//usage:     "\n    -f  Force umount (i.e., unreachable NFS server)"
     24//usage:    IF_FEATURE_MOUNT_LOOP(
     25//usage:     "\n    -D  Don't free loop device even if it has been used"
     26//usage:    )
     27//usage:
     28//usage:#define umount_example_usage
     29//usage:       "$ umount /dev/hdc1\n"
     30
    1031#include <mntent.h>
    1132#include <sys/mount.h>
     
    2445#endif
    2546
    26 /* ignored: -v -d -t -i */
    27 #define OPTION_STRING           "fldnra" "vdt:i"
     47/* Ignored: -v -t -i
     48 * bbox always acts as if -d is present.
     49 * -D can be used to suppress it (bbox extension).
     50 * Rationale:
     51 * (1) util-linux's umount does it if "loop=..." is seen in /etc/mtab:
     52 * thus, on many systems, bare umount _does_ drop loop devices.
     53 * (2) many users request this feature.
     54 */
     55#define OPTION_STRING           "fldDnra" "vt:i"
    2856#define OPT_FORCE               (1 << 0) // Same as MNT_FORCE
    2957#define OPT_LAZY                (1 << 1) // Same as MNT_DETACH
    30 #define OPT_FREELOOP            (1 << 2)
    31 #define OPT_NO_MTAB             (1 << 3)
    32 #define OPT_REMOUNT             (1 << 4)
    33 #define OPT_ALL                 (ENABLE_FEATURE_UMOUNT_ALL ? (1 << 5) : 0)
     58//#define OPT_FREE_LOOP           (1 << 2) // -d is assumed always present
     59#define OPT_DONT_FREE_LOOP      (1 << 3)
     60#define OPT_NO_MTAB             (1 << 4)
     61#define OPT_REMOUNT             (1 << 5)
     62#define OPT_ALL                 (ENABLE_FEATURE_UMOUNT_ALL ? (1 << 6) : 0)
    3463
    3564int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     
    145174            // De-allocate the loop device.  This ioctl should be ignored on
    146175            // any non-loop block devices.
    147             if (ENABLE_FEATURE_MOUNT_LOOP && (opt & OPT_FREELOOP) && m)
     176            if (ENABLE_FEATURE_MOUNT_LOOP && !(opt & OPT_DONT_FREE_LOOP) && m)
    148177                del_loop(m->device);
    149178            if (ENABLE_FEATURE_MTAB_SUPPORT && !(opt & OPT_NO_MTAB) && m)
Note: See TracChangeset for help on using the changeset viewer.