1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ctdb-daemon: Return negative status only if there are known errors

If event script does not exist or does not have execute permissions, then
return negative errno to distinguish from the exit errors of event script.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Amitay Isaacs 2014-01-23 14:57:53 +11:00 committed by Martin Schwenke
parent b112a3317c
commit 1566790e5a

View File

@ -127,7 +127,10 @@ int main(int argc, char *argv[])
waitpid(pid, &status, 0);
if (WIFEXITED(status)) {
output = -WEXITSTATUS(status);
output = WEXITSTATUS(status);
if (output == ENOENT || output == ENOEXEC) {
output = -output;
}
write(write_fd, &output, sizeof(output));
exit(output);
}