X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fprocess.c;h=a06f5dc13e82e0b401d70c9559b1a73520ce3187;hb=21e087cf0dff612754649f43fdf9715f701cae7a;hp=c3e3de5ce5c7b9fb200adb9442a870e45bcacdae;hpb=9920772dcc7d118444a22b53f5e9c0db2a844702;p=sliver-openvswitch.git diff --git a/lib/process.c b/lib/process.c index c3e3de5ce..a06f5dc13 100644 --- a/lib/process.c +++ b/lib/process.c @@ -313,15 +313,19 @@ process_status_msg(int status) struct ds ds = DS_EMPTY_INITIALIZER; if (WIFEXITED(status)) { ds_put_format(&ds, "exit status %d", WEXITSTATUS(status)); - } else if (WIFSIGNALED(status)) { + } else if (WIFSIGNALED(status) || WIFSTOPPED(status)) { + int signr = WIFSIGNALED(status) ? WTERMSIG(status) : WSTOPSIG(status); const char *name = NULL; #ifdef HAVE_STRSIGNAL - name = strsignal(WTERMSIG(status)); + name = strsignal(signr); #endif - ds_put_format(&ds, "killed by signal %d", WTERMSIG(status)); + ds_put_format(&ds, "%s by signal %d", + WIFSIGNALED(status) ? "killed" : "stopped", signr); if (name) { ds_put_format(&ds, " (%s)", name); } + } else { + ds_put_format(&ds, "terminated abnormally (%x)", status); } if (WCOREDUMP(status)) { ds_put_cstr(&ds, ", core dumped");