Revert "tevent_coroutine: let tevent_coroutine_yield() check for subreq == NULL,...
authorStefan Metzmacher <metze@samba.org>
Sat, 22 May 2010 10:07:10 +0000 (12:07 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Apr 2013 09:21:51 +0000 (11:21 +0200)
This reverts commit 568884ef8235d3910dc8d51abc76586ab3be71b8.

lib/util/tevent_coroutine.c
source4/ntvfs/ipc/vfs_ipc.c

index b1d606478030465139f389bce5ff9416c8b1e07c..ddbe3d049c9690c5affb452df5d53b0c7cb475f4 100644 (file)
@@ -165,19 +165,6 @@ void _tevent_coroutine_yield(struct tevent_coroutine *tco,
                             struct tevent_req *subreq,
                             const char *location)
 {
-       if (subreq == NULL) {
-               tco->result.state = TEVENT_COROUTINE_NO_MEMORY;
-               tco->result.location = location;
-               tco->result.return_location = location;
-               /*
-                * this jumps back to tevent_coroutine_run() after
-                * co_call().
-                */
-               tco->coro = NULL;
-               co_exit();
-               return;
-       }
-
        tco->result.state = TEVENT_COROUTINE_YIELD;
        tco->result.location = location;
 
index de51533c38b92a20df1fe5019e3d291b14041856..e2648852203e53a7c71081356bd1505e2081a51e 100644 (file)
@@ -681,7 +681,6 @@ static struct tevent_coroutine_result *example_ocor_body(struct tevent_coroutine
        }
        tevent_coroutine_yield(coro, subreq);
        ok = tevent_wakeup_recv(subreq);
-       TALLOC_FREE(subreq);
 
        DEBUG(0,("%s[%p]: 2. %s wakeup[%d]\n", __location__, coro, state->string, ok));
 
@@ -752,7 +751,6 @@ static struct tevent_coroutine_result *example_coro_body(struct tevent_coroutine
        }
        tevent_coroutine_yield(coro, subreq);
        ret = example_ocor_recv(subreq, &sys_errno);
-       TALLOC_FREE(subreq);
        if (ret == -1) {
                tevent_coroutine_error(coro, sys_errno);
                return tevent_coroutine_return(coro);
@@ -760,20 +758,6 @@ static struct tevent_coroutine_result *example_coro_body(struct tevent_coroutine
 
        DEBUG(0,("%s:%s[%p]: 2. %s example_ocor[%d]\n", __location__, __FUNCTION__, coro, state->string, ret));
 
-       subreq = example_ocor_send(state, ev, state->string);
-       if (tevent_coroutine_nomem(subreq, coro)) {
-               return tevent_coroutine_return(coro);
-       }
-       tevent_coroutine_yield(coro, subreq);
-       ret = example_ocor_recv(subreq, &sys_errno);
-       TALLOC_FREE(subreq);
-       if (ret == -1) {
-               tevent_coroutine_error(coro, sys_errno);
-               return tevent_coroutine_return(coro);
-       }
-
-       DEBUG(0,("%s:%s[%p]: 3. %s example_ocor[%d]\n", __location__, __FUNCTION__, coro, state->string, ret));
-
        tevent_coroutine_done(coro);
        return tevent_coroutine_return(coro);
 }