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/coreutils/mkdir.c

    r2725 r3232  
    2020 */
    2121
     22//usage:#define mkdir_trivial_usage
     23//usage:       "[OPTIONS] DIRECTORY..."
     24//usage:#define mkdir_full_usage "\n\n"
     25//usage:       "Create DIRECTORY\n"
     26//usage:     "\n    -m MODE Mode"
     27//usage:     "\n    -p  No error if exists; make parent directories as needed"
     28//usage:    IF_SELINUX(
     29//usage:     "\n    -Z  Set security context"
     30//usage:    )
     31//usage:
     32//usage:#define mkdir_example_usage
     33//usage:       "$ mkdir /tmp/foo\n"
     34//usage:       "$ mkdir /tmp/foo\n"
     35//usage:       "/tmp/foo: File exists\n"
     36//usage:       "$ mkdir /tmp/foo/bar/baz\n"
     37//usage:       "/tmp/foo/bar/baz: No such file or directory\n"
     38//usage:       "$ mkdir -p /tmp/foo/bar/baz\n"
     39
    2240#include "libbb.h"
    2341
     
    3149    "context\0" Required_argument "Z"
    3250#endif
     51    "verbose\0" No_argument       "v"
    3352    ;
    3453#endif
     
    3756int mkdir_main(int argc UNUSED_PARAM, char **argv)
    3857{
    39     mode_t mode = (mode_t)(-1);
     58    long mode = -1;
    4059    int status = EXIT_SUCCESS;
    4160    int flags = 0;
     
    4968    applet_long_options = mkdir_longopts;
    5069#endif
    51     opt = getopt32(argv, "m:p" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext));
     70    opt = getopt32(argv, "m:p" IF_SELINUX("Z:") "v", &smode IF_SELINUX(,&scontext));
    5271    if (opt & 1) {
    53         mode = 0777;
    54         if (!bb_parse_mode(smode, &mode)) {
     72        mode_t mmode = 0777;
     73        if (!bb_parse_mode(smode, &mmode)) {
    5574            bb_error_msg_and_die("invalid mode '%s'", smode);
    5675        }
     76        mode = mmode;
    5777    }
    5878    if (opt & 2)
Note: See TracChangeset for help on using the changeset viewer.