git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b112a33
)
ctdb-daemon: Return negative status only if there are known errors
author
Amitay Isaacs
<amitay@gmail.com>
Thu, 23 Jan 2014 03:57:53 +0000
(14:57 +1100)
committer
Martin Schwenke
<martin@meltin.net>
Fri, 31 Jan 2014 04:57:49 +0000
(15:57 +1100)
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>
ctdb/server/ctdb_event_helper.c
patch
|
blob
|
history
diff --git
a/ctdb/server/ctdb_event_helper.c
b/ctdb/server/ctdb_event_helper.c
index 4c62e41af631e9bc62452564c7087733037f64a5..ab1eae44091b19f822cdbd5483dd6ae7903f3740 100644
(file)
--- a/
ctdb/server/ctdb_event_helper.c
+++ b/
ctdb/server/ctdb_event_helper.c
@@
-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);
}