From: Ronnie Sahlberg Date: Mon, 14 Dec 2009 23:45:18 +0000 (+1100) Subject: When setting up the logging, set the event to trigger a read of a log message from... X-Git-Tag: ctdb-1.0.109~11 X-Git-Url: http://git.samba.org/?p=sahlberg%2Fctdb.git;a=commitdiff_plain;h=ea9e39369379939abf6a4076fa2014c10c1a9ad0 When setting up the logging, set the event to trigger a read of a log message from a child process as a child of the "log" structure and not the ctdb structure, or else we can crash if we receive log messages from a child but the log structure has been freed() --- diff --git a/server/ctdb_logging.c b/server/ctdb_logging.c index 9aba7f83..770deb6a 100644 --- a/server/ctdb_logging.c +++ b/server/ctdb_logging.c @@ -509,7 +509,7 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb) return -1; } - event_add_fd(ctdb->ev, ctdb, p[0], EVENT_FD_READ, + event_add_fd(ctdb->ev, ctdb->log, p[0], EVENT_FD_READ, ctdb_log_handler, ctdb->log); set_close_on_exec(p[0]); ctdb->log->pfd = p[0];