- if (WIFEXITED(stat) && WEXITSTATUS(stat) < 256)
- {
- if (WEXITSTATUS(stat))
- sprintf(pr->status_msg, "died with exit code %d", WEXITSTATUS(stat));
- else
- pr->status_msg[0] = 0;
- }
- else if (WIFSIGNALED(stat))
- sprintf(pr->status_msg, "died on signal %d", WTERMSIG(stat));
- else
- sprintf(pr->status_msg, "died with status %x", stat);