commit fad7b23c17ece19cc9967cad9b8f83a191344da7
parent 8206659c8c77b127d27ec19862ebea0c40418637
Author: Tomas Hlavaty <tom@logand.com>
Date: Fri, 28 Jan 2011 02:05:39 +0100
systemf return value fix
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils.c b/utils.c
@@ -97,7 +97,9 @@ int systemf(char *cmd, ...) {
char buf[BLEN];
vsnprintf(buf, BLEN, cmd, v);
va_end(v);
- return system(buf);
+ fprintf(stderr, "sh: %s\n", buf); // TODO remove
+ int x = system(buf);
+ return 0 <= x && WIFEXITED(x) ? WEXITSTATUS(x) : -1;
}
void wget(char *url, char *fname) {