[hackers] [sbase] Use _exit() instead of return if exec* fails || sin

From: <git_AT_suckless.org>
Date: Thu, 13 Nov 2014 18:07:15 +0100

commit 44b3ea8f762daa9b4f6bf13ebd58e2c3d1fc6e84
Author: sin <sin_AT_2f30.org>
Date: Thu Nov 13 17:06:18 2014 +0000

    Use _exit() instead of return if exec* fails

diff --git a/nohup.c b/nohup.c
index 6ac9d2b..f1da290 100644
--- a/nohup.c
+++ b/nohup.c
_AT_@ -33,7 +33,7 @@ main(int argc, char *argv[])
 
         if(isatty(STDOUT_FILENO)) {
                 if((fd = open("nohup.out", O_APPEND|O_CREAT,
- S_IRUSR|S_IWUSR)) == -1) {
+ S_IRUSR|S_IWUSR)) == -1) {
                         enprintf(Error, "open nohup.out:");
                 }
                 if(dup2(fd, STDOUT_FILENO) == -1)
_AT_@ -46,6 +46,5 @@ main(int argc, char *argv[])
 
         execvp(argv[0], &argv[0]);
         enprintf(errno == ENOENT ? Error : Found, "exec %s:", argv[0]);
-
- return Error;
+ _exit(Error);
 }
Received on Thu Nov 13 2014 - 18:07:15 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 13 2014 - 18:12:09 CET