diff --git a/ctdb/server/ctdb_event_helper.c b/ctdb/server/ctdb_event_helper.c index 4c62e41af63..ab1eae44091 100644 --- 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); }