]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fixed system() return handling
authorAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 07:00:08 +0000 (17:00 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 07:00:08 +0000 (17:00 +1000)
(This used to be ctdb commit 0fa75d7429f6f6e58f98c3cebccf6014eb3b474e)

ctdb/takeover/system.c

index 493eddefa731d66f4e238877f95edcd91107f97a..c6624f24857e681f5db52b7507d51f1910a05d4a 100644 (file)
@@ -275,6 +275,9 @@ int ctdb_event_script(struct ctdb_context *ctdb, const char *fmt, ...)
        CTDB_NO_MEMORY(ctdb, cmdstr);
 
        ret = system(cmdstr);
+       if (ret != -1) {
+               ret = WEXITSTATUS(ret);
+       }
 
        talloc_free(cmdstr);
        talloc_free(options);