diff options
author | Ori Bernstein <ori@eigenstate.org> | 2012-10-24 20:06:18 -0400 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2012-10-24 20:06:18 -0400 |
commit | 2346727d8b1e5a708007d95989c8eee197abe0c5 (patch) | |
tree | ee642c8cd577768d375d4889d246f1944b0c747b /myrbuild | |
parent | a4700546fc1fc899acdec66cf27a9f147e9f8fe5 (diff) | |
download | mc-2346727d8b1e5a708007d95989c8eee197abe0c5.tar.gz |
Give myrbuild a better command failure msg
Diffstat (limited to 'myrbuild')
-rw-r--r-- | myrbuild/myrbuild.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/myrbuild/myrbuild.c b/myrbuild/myrbuild.c index 0469f68..b69b019 100644 --- a/myrbuild/myrbuild.c +++ b/myrbuild/myrbuild.c @@ -115,8 +115,10 @@ void run(char **cmd) } else { waitpid(pid, &status, 0); } - if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) - die("Command failed"); + if (WIFEXITED(status) && WEXITSTATUS(status) != 0) + die("%s: exited with status %d\n", cmd[0], WEXITSTATUS(status)); + else if (WIFSIGNALED(status)) + die("%s: exited with signal %d\n", cmd[0], WTERMSIG(status)); } int isfresh(char *from, char *to) |