summaryrefslogtreecommitdiff
path: root/src/mkfifo.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-04-26 12:20:54 +0000
committerJim Meyering <jim@meyering.net>1999-04-26 12:20:54 +0000
commitd0eeabbc32898e5640941b36b92e5060ebf03dd0 (patch)
tree8cc97a3974c3610e612a6e432d37e72eae5d354f /src/mkfifo.c
parent259838277ba4f363ebbb1c3abf87315915f0e0bc (diff)
downloadcoreutils-d0eeabbc32898e5640941b36b92e5060ebf03dd0.tar.xz
Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
Diffstat (limited to 'src/mkfifo.c')
-rw-r--r--src/mkfifo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mkfifo.c b/src/mkfifo.c
index a08ab57d2..fea25f330 100644
--- a/src/mkfifo.c
+++ b/src/mkfifo.c
@@ -60,7 +60,7 @@ usage (int status)
printf (_("\
Create named pipes (FIFOs) with the given NAMEs.\n\
\n\
- -m, --mode=MODE set permission mode (as in chmod), not 0666 - umask\n\
+ -m, --mode=MODE set permission mode (as in chmod), not a=rw - umask\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
@@ -74,7 +74,7 @@ Create named pipes (FIFOs) with the given NAMEs.\n\
int
main (int argc, char **argv)
{
- unsigned short newmode;
+ mode_t newmode;
struct mode_change *change;
const char *symbolic_mode;
int errors = 0;
@@ -112,7 +112,8 @@ main (int argc, char **argv)
usage (1);
}
- newmode = 0666 & ~umask (0);
+ newmode = ((S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
+ & ~ umask (0));
if (symbolic_mode)
{
change = mode_compile (symbolic_mode, 0);