]> granicus.if.org Git - shadow/commitdiff
* NEWS, src/newgrp.c: Return the exit status of the child. Thanks
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 22 May 2009 11:10:02 +0000 (11:10 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 22 May 2009 11:10:02 +0000 (11:10 +0000)
to Lionel Elie Mamane.

src/newgrp.c

index 1b19b90a100a2723ccb09ff05fafacc67447df1d..e4ea4115eba2bcef1c9a163398acbb27067a0bca 100644 (file)
@@ -347,7 +347,8 @@ static void syslog_sg (const char *name, const char *group)
                                         (unsigned long) gid, name));
                        }
                        closelog ();
-                       exit (E_SUCCESS);
+                       exit ((0 != WIFEXITED (cst)) ? WEXITSTATUS (cst)
+                                                    : WTERMSIG (cst) + 128);
                }
 
                /* child - restore signals to their default state */