aboutsummaryrefslogtreecommitdiff
path: root/coreutils/mkdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/mkdir.c')
-rw-r--r--coreutils/mkdir.c4
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)
#endif
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)) {
+ mode_t mmode = bb_parse_mode(smode, 0777);
+ if (mmode == (mode_t)-1) {
bb_error_msg_and_die("invalid mode '%s'", smode);
}
mode = mmode;