diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-02-18 19:59:30 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-02-18 19:59:30 +0100 |
commit | 144f49bdee2dd7d29748d2c3d2e3c0e5cfbfa34d (patch) | |
tree | d3e5124c81bd7b15ba9325e072efbb58c682d999 /src/blogc-git-receiver | |
parent | 1d790b8c78a2925a788e7167ed8d9d52d8e23906 (diff) | |
download | blogc-144f49bdee2dd7d29748d2c3d2e3c0e5cfbfa34d.tar.gz blogc-144f49bdee2dd7d29748d2c3d2e3c0e5cfbfa34d.tar.bz2 blogc-144f49bdee2dd7d29748d2c3d2e3c0e5cfbfa34d.zip |
make: git-receiver: fixes to build on OS X. patch by @blackgear
Diffstat (limited to 'src/blogc-git-receiver')
-rw-r--r-- | src/blogc-git-receiver/pre-receive.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/blogc-git-receiver/pre-receive.c b/src/blogc-git-receiver/pre-receive.c index 15db99a..7ba6982 100644 --- a/src/blogc-git-receiver/pre-receive.c +++ b/src/blogc-git-receiver/pre-receive.c @@ -196,7 +196,8 @@ bgr_pre_receive_hook(int argc, char *argv[]) // command. char *build_cmd = NULL; if (0 == access("blogcfile", F_OK)) { - if (127 == WEXITSTATUS(system("blogc-make -v 2> /dev/null > /dev/null"))) { + int status_bmake = system("blogc-make -v 2> /dev/null > /dev/null"); + if (127 == WEXITSTATUS(status_bmake)) { fprintf(stderr, "error: failed to find blogc-make binary\n"); rv = 3; goto cleanup; @@ -207,11 +208,15 @@ bgr_pre_receive_hook(int argc, char *argv[]) else if ((0 == access("Makefile", F_OK)) || (0 == access("GNUMakefile", F_OK))) { const char *make_impl = NULL; - if (127 != WEXITSTATUS(system("gmake -f /dev/null 2> /dev/null > /dev/null"))) { + int status_gmake = system("gmake -f /dev/null 2> /dev/null > /dev/null"); + if (127 != WEXITSTATUS(status_gmake)) { make_impl = "gmake"; } - else if (127 != WEXITSTATUS(system("make -f /dev/null 2> /dev/null > /dev/null"))) { - make_impl = "make"; + else { + int status_make = system("make -f /dev/null 2> /dev/null > /dev/null"); + if (127 != WEXITSTATUS(status_make)) { + make_impl = "make"; + } } if (make_impl == NULL) { |