diff options
Diffstat (limited to 'coreutils/mkdir.c')
-rw-r--r-- | coreutils/mkdir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 864edfb0a..6f7b004dd 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
@@ -71,8 +71,8 @@ int mkdir_main(int argc UNUSED_PARAM, char **argv) | |||
71 | #endif | 71 | #endif |
72 | opt = getopt32(argv, "m:pv" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext)); | 72 | opt = getopt32(argv, "m:pv" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext)); |
73 | if (opt & 1) { | 73 | if (opt & 1) { |
74 | mode_t mmode = 0777; | 74 | mode_t mmode = bb_parse_mode(smode, 0777); |
75 | if (!bb_parse_mode(smode, &mmode)) { | 75 | if (mmode == (mode_t)-1) { |
76 | bb_error_msg_and_die("invalid mode '%s'", smode); | 76 | bb_error_msg_and_die("invalid mode '%s'", smode); |
77 | } | 77 | } |
78 | mode = mmode; | 78 | mode = mmode; |