diff options
author | Jim Meyering <jim@meyering.net> | 1999-04-26 12:49:59 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-04-26 12:49:59 +0000 |
commit | 750e5969ff64a6763ad35abbda6eaa6202719d5d (patch) | |
tree | 09e37036b26d0df78dbde2d12d63d27ab202cfff /src | |
parent | 6fc1cc1b6ad7c11aa060741dd5a881e4dd1f1c2b (diff) | |
download | coreutils-750e5969ff64a6763ad35abbda6eaa6202719d5d.tar.xz |
(main): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
Diffstat (limited to 'src')
-rw-r--r-- | src/mkdir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mkdir.c b/src/mkdir.c index 5c352c91e..f9ea3b99f 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -75,8 +75,8 @@ Create the DIRECTORY(ies), if they do not already exist.\n\ int main (int argc, char **argv) { - unsigned int newmode; - unsigned int parent_mode; + mode_t newmode; + mode_t parent_mode; const char *symbolic_mode = NULL; const char *verbose_fmt_string = NULL; int errors = 0; @@ -117,8 +117,8 @@ main (int argc, char **argv) usage (1); } - newmode = 0777 & ~umask (0); - parent_mode = newmode | 0300; /* u+wx */ + newmode = (S_IRWXU | S_IRWXG | S_IRWXO) & ~ umask (0); + parent_mode = S_IWUSR | S_IXUSR | newmode; if (symbolic_mode) { struct mode_change *change = mode_compile (symbolic_mode, 0); |