From f596cd113c1e7f4e4f9d35dbe7f155e7122fce91 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Fri, 22 May 2009 11:10:02 +0000 Subject: [PATCH] * NEWS, src/newgrp.c: Return the exit status of the child. Thanks to Lionel Elie Mamane. --- src/newgrp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/newgrp.c b/src/newgrp.c index 1b19b90a..e4ea4115 100644 --- a/src/newgrp.c +++ b/src/newgrp.c @@ -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 */ -- 2.40.0