aboutsummaryrefslogtreecommitdiff
path: root/coreutils/mkdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/mkdir.c')
-rw-r--r--coreutils/mkdir.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 4a8e43e43..864edfb0a 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -48,7 +48,9 @@ static const char mkdir_longopts[] ALIGN1 =
#if ENABLE_SELINUX
"context\0" Required_argument "Z"
#endif
+#if ENABLE_FEATURE_VERBOSE
"verbose\0" No_argument "v"
+#endif
;
#endif
@@ -67,7 +69,7 @@ int mkdir_main(int argc UNUSED_PARAM, char **argv)
#if ENABLE_FEATURE_MKDIR_LONG_OPTIONS
applet_long_options = mkdir_longopts;
#endif
- opt = getopt32(argv, "m:p" IF_SELINUX("Z:") "v", &smode IF_SELINUX(,&scontext));
+ opt = getopt32(argv, "m:pv" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext));
if (opt & 1) {
mode_t mmode = 0777;
if (!bb_parse_mode(smode, &mmode)) {
@@ -77,8 +79,10 @@ int mkdir_main(int argc UNUSED_PARAM, char **argv)
}
if (opt & 2)
flags |= FILEUTILS_RECUR;
+ if ((opt & 4) && FILEUTILS_VERBOSE)
+ flags |= FILEUTILS_VERBOSE;
#if ENABLE_SELINUX
- if (opt & 4) {
+ if (opt & 8) {
selinux_or_die();
setfscreatecon_or_die(scontext);
}