aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/mkdir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 6a4ce6e1a..f003db99f 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -41,8 +41,10 @@ extern int mkdir_main (int argc, char **argv)
switch (opt) {
case 'm':
mode = 0777;
- if (!parse_mode (optarg, &mode))
+ if (!parse_mode (optarg, &mode)) {
error_msg_and_die ("invalid mode `%s'", optarg);
+ }
+ umask(0);
break;
case 'p':
flags |= FILEUTILS_RECUR;