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:
parent
b112a3317c
commit
1566790e5a
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user