From: Ronnie Sahlberg Date: Sun, 6 May 2007 21:54:17 +0000 (+1000) Subject: hang the timeout event off state and thus we dont need to explicitely X-Git-Tag: tevent-0.9.20~348^2~2768^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a1866c6eebff3b7a781c6fc94614b68f3d524bb6;p=thirdparty%2Fsamba.git hang the timeout event off state and thus we dont need to explicitely free it and also we wont accidentally return from the function without killing the event first (This used to be ctdb commit e3d72d024ef7342a808e5c488fd646a39e5fac78) --- diff --git a/ctdb/common/ctdb_client.c b/ctdb/common/ctdb_client.c index e51c31bc2d3..02ad4c2d0e2 100644 --- a/ctdb/common/ctdb_client.c +++ b/ctdb/common/ctdb_client.c @@ -679,7 +679,6 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid, size_t len; int ret; uint32_t timed_out; - struct timed_event *te=NULL; /* if the domain socket is not yet open, open it */ if (ctdb->daemon.sd==-1) { @@ -723,7 +722,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid, /* semi-async operation */ timed_out = 0; if (timeout) { - te=event_add_timed(ctdb->ev, mem_ctx, *timeout, timeout_func, &timed_out); + event_add_timed(ctdb->ev, state, *timeout, timeout_func, &timed_out); } while ((state->state == CTDB_CALL_WAIT) && (timed_out == 0) ){ @@ -734,10 +733,6 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid, return -1; } - if ((timed_out==0) && te) { - talloc_free(te); - } - if (outdata) { *outdata = state->outdata; outdata->dptr = talloc_memdup(mem_ctx, outdata->dptr, outdata->dsize);