X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fexitstatus.c;h=7ce1ff5ac7ec17023a3912aa933ff8adea6f9cd0;hb=dd4af9ab4aa5e39ff3db44466b07b0c119b8aa21;hp=fec5593f1ee8a45720bbdba6f9bb1c3570ad07a2;hpb=fa7aa6d9457616ce28f97c83eaa616d0ff276870;p=libucw.git diff --git a/ucw/exitstatus.c b/ucw/exitstatus.c index fec5593f..7ce1ff5a 100644 --- a/ucw/exitstatus.c +++ b/ucw/exitstatus.c @@ -1,7 +1,7 @@ /* * UCW Library -- Formatting of Process Exit Status * - * (c) 2004 Martin Mares + * (c) 2004--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -30,7 +31,11 @@ format_exit_status(char *msg, int stat) } } else if (WIFSIGNALED(stat)) - sprintf(msg, "died on signal %d", WTERMSIG(stat)); + { + int sig = WTERMSIG(stat); + const char *sn = sig_number_to_name(sig); + sprintf(msg, "died on signal %d (%s)", sig, (sn ? : "unknown")); + } else sprintf(msg, "died with status %x", stat); return 1;