summaryrefslogtreecommitdiff
path: root/myrbuild
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-10-24 20:06:18 -0400
committerOri Bernstein <ori@eigenstate.org>2012-10-24 20:06:18 -0400
commit2346727d8b1e5a708007d95989c8eee197abe0c5 (patch)
treeee642c8cd577768d375d4889d246f1944b0c747b /myrbuild
parenta4700546fc1fc899acdec66cf27a9f147e9f8fe5 (diff)
downloadmc-2346727d8b1e5a708007d95989c8eee197abe0c5.tar.gz
Give myrbuild a better command failure msg
Diffstat (limited to 'myrbuild')
-rw-r--r--myrbuild/myrbuild.c6
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)