[hackers] [sbase] Don't stop at first failure in mkfifo(1) || sin
commit d0604cc474fc8de5de45ae087b966cd991c9c0ff
Author: sin <sin_AT_2f30.org>
Date: Sat Nov 22 11:18:05 2014 +0000
Don't stop at first failure in mkfifo(1)
diff --git a/mkfifo.c b/mkfifo.c
index 8c78441..fbaee4c 100644
--- a/mkfifo.c
+++ b/mkfifo.c
_AT_@ -17,6 +17,7 @@ main(int argc, char *argv[])
{
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP | S_IROTH | S_IWOTH;
+ int ret = 0;
ARGBEGIN {
case 'm':
_AT_@ -29,8 +30,11 @@ main(int argc, char *argv[])
if (argc < 1)
usage();
- for (; argc > 0; argc--, argv++)
- if (mkfifo(argv[0], mode) < 0)
- eprintf("mkfifo %s:", argv[0]);
- return 0;
+ for (; argc > 0; argc--, argv++) {
+ if (mkfifo(argv[0], mode) < 0) {
+ weprintf("mkfifo %s:", argv[0]);
+ ret = 1;
+ }
+ }
+ return ret;
}
Received on Sat Nov 22 2014 - 12:18:25 CET
This archive was generated by hypermail 2.3.0
: Sat Nov 22 2014 - 12:24:11 CET