[hackers] [utmp] Return the status of child as status of utmp || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sun, 10 Aug 2014 21:25:42 +0200

commit 462c252f861254ba1ce1c0334ccad28f0e4c08c7
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Thu Aug 7 15:44:14 2014 +0200

    Return the status of child as status of utmp
    
    It makes possible to can know what was the the exit status of the
    command passed to utmp.

diff --git a/utmp.c b/utmp.c
index d0d556c..6e213ef 100644
--- a/utmp.c
+++ b/utmp.c
_AT_@ -78,5 +78,5 @@ main(int argc, char *argv[])
                         perror("error waiting child");
                 delutmp();
         }
- return 0;
+ return (WIFEXITED(status)) ? WEXITSTATUS(status) : EXIT_FAILURE;
 }
Received on Sun Aug 10 2014 - 21:25:42 CEST

This archive was generated by hypermail 2.3.0 : Sun Aug 10 2014 - 21:36:10 CEST