X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprocess.c;h=cbb190a5a9abea30241af0dce8769b602a02d37a;hb=9699f08afc6420d2bdac1063ea6789b585aaf42e;hp=04c19ed9ee3164989dc4fb6284d9c9b1ca5100e3;hpb=f5bb64b36ae0807cdd3f241f81a8e933065437f6;p=tinc diff --git a/src/process.c b/src/process.c index 04c19ed9..cbb190a5 100644 --- a/src/process.c +++ b/src/process.c @@ -1,7 +1,7 @@ /* process.c -- process management functions Copyright (C) 1999-2005 Ivo Timmermans, - 2000-2012 Guus Sliepen + 2000-2013 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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; }