X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprocess.c;h=cbb190a5a9abea30241af0dce8769b602a02d37a;hb=3847b78ba5900fe4311e9ef62474e32e1a6750e5;hp=0f399e79605dc8a7e357427beb06113cc9a45a15;hpb=1bb969c9306812d0d5c954fe8db32ed1a248bf20;p=tinc diff --git a/src/process.c b/src/process.c index 0f399e79..cbb190a5 100644 --- a/src/process.c +++ b/src/process.c @@ -259,8 +259,8 @@ bool execute_script(const char *name, char **envp) { } } -#ifdef WEXITSTATUS if(status != -1) { +#ifdef WEXITSTATUS if(WIFEXITED(status)) { /* Child exited by itself */ if(WEXITSTATUS(status)) { logger(DEBUG_ALWAYS, LOG_ERR, "Script %s exited with non-zero status %d", @@ -275,11 +275,11 @@ bool execute_script(const char *name, char **envp) { logger(DEBUG_ALWAYS, LOG_ERR, "Script %s terminated abnormally", name); return false; } +#endif } else { logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "system", strerror(errno)); return false; } -#endif #endif return true; }