diff options
author | Ondrej Oprala | 2012-09-11 16:39:17 +0200 |
---|---|---|
committer | Karel Zak | 2012-09-21 12:37:18 +0200 |
commit | ea8a10391b9cba4b472d843b7108c0b140a392ab (patch) | |
tree | 49a53c004c16b57a723e8d435c989d939d8f82bb /login-utils | |
parent | lsblk: fix processing of dm partition mappings (diff) | |
download | kernel-qcow2-util-linux-ea8a10391b9cba4b472d843b7108c0b140a392ab.tar.gz kernel-qcow2-util-linux-ea8a10391b9cba4b472d843b7108c0b140a392ab.tar.xz kernel-qcow2-util-linux-ea8a10391b9cba4b472d843b7108c0b140a392ab.zip |
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 <P@draigBrady.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/su-common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/login-utils/su-common.c b/login-utils/su-common.c index 23ad57dc3..274930313 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 |