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>
This commit is contained in:
parent
da30cb2a87
commit
ea8a10391b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue