Revert "example_coro: make the callers simpler as tevent_coroutine_yield does the...
authorStefan Metzmacher <metze@samba.org>
Sat, 22 May 2010 10:07:03 +0000 (12:07 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Apr 2013 09:21:49 +0000 (11:21 +0200)
This reverts commit 9371dab717c20e8a08afc7826b93e15fca84707e.

source4/ntvfs/ipc/vfs_ipc.c

index fd45a6dbb1608fe347df098e233b437d7c859c0d..de51533c38b92a20df1fe5019e3d291b14041856 100644 (file)
@@ -676,13 +676,12 @@ static struct tevent_coroutine_result *example_ocor_body(struct tevent_coroutine
        DEBUG(0,("%s[%p]: 1. %s\n", __location__, coro, state->string));
 
        subreq = tevent_wakeup_send(state, ev, timeval_current_ofs(0,500));
+       if (tevent_coroutine_nomem(subreq, coro)) {
+               return tevent_coroutine_return(coro);
+       }
        tevent_coroutine_yield(coro, subreq);
        ok = tevent_wakeup_recv(subreq);
        TALLOC_FREE(subreq);
-       if (!ok) {
-               tevent_coroutine_error(coro, ENOTSUP);
-               return tevent_coroutine_return(coro);
-       }
 
        DEBUG(0,("%s[%p]: 2. %s wakeup[%d]\n", __location__, coro, state->string, ok));
 
@@ -748,6 +747,9 @@ static struct tevent_coroutine_result *example_coro_body(struct tevent_coroutine
        DEBUG(0,("%s:%s[%p]: 1. %s\n", __location__, __FUNCTION__, coro, state->string));
 
        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);
@@ -759,6 +761,9 @@ 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);