[hackers] [sbase] fork: no need to _exit() on the error case || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Wed, 11 Mar 2015 13:42:33 +0100 (CET)

commit 01a69ce7350dde35b0c1012399c44eee93844b33
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Tue Mar 10 20:05:18 2015 +0100

    fork: no need to _exit() on the error case

diff --git a/setsid.c b/setsid.c
index 212100b..98acaae 100644
--- a/setsid.c
+++ b/setsid.c
_AT_@ -26,8 +26,7 @@ main(int argc, char *argv[])
         if (getpgrp() == getpid()) {
                 switch (fork()) {
                 case -1:
- weprintf("fork:");
- _exit(1);
+ eprintf("fork:");
                 case 0:
                         break;
                 default:
diff --git a/tar.c b/tar.c
index 9e00d87..8c6fdac 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -54,8 +54,7 @@ decomp(FILE *fp)
 
         switch (fork()) {
         case -1:
- weprintf("fork:");
- _exit(1);
+ eprintf("fork:");
         case 0:
                 dup2(fileno(fp), 0);
                 dup2(fds[1], 1);
diff --git a/time.c b/time.c
index 3ff25ac..fb7d572 100644
--- a/time.c
+++ b/time.c
_AT_@ -41,8 +41,7 @@ main(int argc, char *argv[])
 
         switch ((pid = fork())) {
         case -1:
- weprintf("fork:");
- _exit(1);
+ eprintf("fork:");
         case 0:
                 execvp(argv[0], argv);
                 savederrno = errno;
diff --git a/xargs.c b/xargs.c
index 322dcd5..8026b57 100644
--- a/xargs.c
+++ b/xargs.c
_AT_@ -168,8 +168,7 @@ spawn(void)
 
         switch (fork()) {
         case -1:
- weprintf("fork:");
- _exit(1);
+ eprintf("fork:");
         case 0:
                 execvp(*cmd, cmd);
                 savederrno = errno;
Received on Wed Mar 11 2015 - 13:42:33 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 11 2015 - 13:48:09 CET