Don't stop at first failure in mkfifo(1)

This commit is contained in:
sin 2014-11-22 11:18:05 +00:00
parent bf8e37625a
commit d0604cc474

View File

@ -17,6 +17,7 @@ main(int argc, char *argv[])
{ {
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP | S_IROTH | S_IWOTH; S_IWGRP | S_IROTH | S_IWOTH;
int ret = 0;
ARGBEGIN { ARGBEGIN {
case 'm': case 'm':
@ -29,8 +30,11 @@ main(int argc, char *argv[])
if (argc < 1) if (argc < 1)
usage(); usage();
for (; argc > 0; argc--, argv++) for (; argc > 0; argc--, argv++) {
if (mkfifo(argv[0], mode) < 0) if (mkfifo(argv[0], mode) < 0) {
eprintf("mkfifo %s:", argv[0]); weprintf("mkfifo %s:", argv[0]);
return 0; ret = 1;
}
}
return ret;
} }