summaryrefslogtreecommitdiffstats
path: root/bin/mkdir/mkdir.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1994-09-08 21:34:33 +0000
committerjkh <jkh@FreeBSD.org>1994-09-08 21:34:33 +0000
commit6cf02f12cc0f10964210a7d1bbdd5a6827ae602d (patch)
tree7d8e3fb88b0047f5e882551c9ee236293cd31506 /bin/mkdir/mkdir.c
parent134df3f722c929c34de709c1a205eb56d430c56a (diff)
downloadFreeBSD-src-6cf02f12cc0f10964210a7d1bbdd5a6827ae602d.zip
FreeBSD-src-6cf02f12cc0f10964210a7d1bbdd5a6827ae602d.tar.gz
[ From Dave Tweten ]
POSIX.2 looks pretty unequivocal to me, and it agrees with you. Under the explanation of the "-p" option, it says, "Each dir operand that names an existing directory shall be ignored without error." Under the explanation of exit status zero, it says, "All the specified directories were created successfully, or the-p option was specified and all the specified directories now exist." Seems to me POSIX requires exactly the behavior you want. [ And I've made the change, which is also now compatible with 1.x - jkh ] Reviewed by: jkh Submitted by: jkh/tweten
Diffstat (limited to 'bin/mkdir/mkdir.c')
-rw-r--r--bin/mkdir/mkdir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index 32d45d5..458ec79 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -104,8 +104,10 @@ main(argc, argv)
}
if (mkdir(*argv, oct ?
omode : getmode(set, S_IRWXU | S_IRWXG | S_IRWXO)) < 0) {
- warn("%s", *argv);
- exitval = 1;
+ if (!pflag) {
+ warn("%s", *argv);
+ exitval = 1;
+ }
}
}
exit(exitval);
OpenPOWER on IntegriCloud