[ 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
This commit is contained in:
Jordan K. Hubbard 1994-09-08 21:34:33 +00:00
parent 7ad3ea76c0
commit d653487a46
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2594

View File

@ -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);