From: Ondrej Oprala Date: Tue, 11 Sep 2012 14:39:17 +0000 (+0200) Subject: su: add segmentation fault reporting of the child process X-Git-Tag: v2.23-rc1~683 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea8a10391b9cba4b472d843b7108c0b140a392ab;p=thirdparty%2Futil-linux.git su: add segmentation fault reporting of the child process Child processes that ended with segmentation fault previously indicated this with return status only. The report is now more verbose if core dump is allowed. Improved-by: Pádraig Brady Signed-off-by: Ondrej Oprala --- diff --git a/login-utils/su-common.c b/login-utils/su-common.c index 23ad57dc3e..2749303136 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -300,7 +300,12 @@ create_watching_parent (void) } if (pid != (pid_t)-1) if (WIFSIGNALED (status)) - status = WTERMSIG (status) + 128; + { + status = WTERMSIG (status) + 128; + if (WCOREDUMP (status)) + fprintf (stderr, _("%s (core dumped)\n"), + strsignal (WTERMSIG (status))); + } else status = WEXITSTATUS (status); else