struct tevent_fd *fde;
pid_t child;
struct timeval start_time;
+ bool have_response;
};
void ctdb_cluster_mutex_set_handler(struct ctdb_cluster_mutex_handle *h,
ret = sys_read(h->fd[0], &c, 1);
+ /* Don't call the handler more than once. It only exists to
+ * process the initial response from the helper. */
+ if (h->have_response) {
+ return;
+ }
+ h->have_response = true;
+
/* If the child wrote status then just pass it to the handler.
* If no status was written then this is an unexpected error
* so pass generic error code to handler. */
h->start_time = timeval_current();
h->fd[0] = -1;
h->fd[1] = -1;
+ h->have_response = false;
ret = pipe(h->fd);
if (ret != 0) {