eventscript: fix case where we fail to create child for some reason
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 8 Apr 2010 01:05:04 +0000 (10:35 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 8 Apr 2010 01:05:04 +0000 (10:35 +0930)
Initialize the child pid to 0 so destructor doesn't try to kill it:

server/eventscript.c:565 Sending SIGTERM to child pid:139742328
Failed to kill child process for eventscript, errno No such process(3)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
server/eventscript.c

index 740955182ef0e7b72cba8f0174114e0c87338705..5e2772bed6e713577c871c1b8e3f88bec9f98070 100644 (file)
@@ -729,6 +729,7 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
                return -1;
        }
        state->current = 0;
+       state->child = 0;
 
        if (!from_user && (call == CTDB_EVENT_MONITOR || call == CTDB_EVENT_STATUS)) {
                ctdb->current_monitor = state;