sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit d0604cc474fc8de5de45ae087b966cd991c9c0ff
parent bf8e37625ac2379fc6fc17caafd9b8875d8a98aa
Author: sin <sin@2f30.org>
Date:   Sat Nov 22 11:18:05 +0000

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

Diffstat:
mkfifo.c | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/mkfifo.c b/mkfifo.c @@ -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': @@ -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; }