Revert "test_event_fd1 error only on read"
authorStefan Metzmacher <metze@samba.org>
Thu, 28 Feb 2013 15:23:35 +0000 (16:23 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 May 2018 07:52:32 +0000 (09:52 +0200)
This reverts commit 6b957a0aec98fa0d5bace8013567078d16f8f520.

lib/tevent/testsuite.c

index 8249fcf1dc09597b44d581c0a8c11b1f21ea4647..3c1ae01670991f8e92a2df9208b2be33e761ab45 100644 (file)
@@ -280,28 +280,13 @@ static void test_event_fd1_fde_handler(struct tevent_context *ev_ctx,
 
                ret = read(state->sock[0], &c, 1);
                if (ret == 1) {
-                       if (flags != (TEVENT_FD_READ|TEVENT_FD_WRITE)) {
-                               state->finished = true;
-                               state->error = __location__;
-                               return;
-                       }
-                       return;
-               }
-
-               /*
-                * EOF and errors should be just reported
-                * by TEVENT_FD_READ.
-                */
-               if (flags != TEVENT_FD_READ) {
-                       state->finished = true;
-                       state->error = __location__;
                        return;
                }
 
                /*
                 * end of test...
                 */
-               TEVENT_FD_NOT_READABLE(fde);
+               tevent_fd_set_flags(fde, 0);
                state->drain_done = true;
                return;
        }