1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-22 02:50:28 +03:00

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)
This commit is contained in:
Ronnie Sahlberg 2007-05-07 07:54:17 +10:00
parent 6bfb5f61ca
commit a1866c6eeb

View File

@ -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);