r20990: check for errors from event_loop_once()
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 Jan 2007 04:30:44 +0000 (04:30 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 Jan 2007 04:30:44 +0000 (04:30 +0000)
source/torture/local/event.c

index 9d15f517eb8a6b0a6e13e3068e932eb5b888bfe0..383e959183c87e1800128eb24dd2bcc4f00e1dbf 100644 (file)
@@ -98,7 +98,11 @@ static bool test_event_context(struct torture_context *test,
 
        t = timeval_current();
        while (!finished) {
-               event_loop_once(ev_ctx);
+               if (event_loop_once(ev_ctx) == -1) {
+                       torture_fail(test, "Failed event loop\n");
+                       talloc_free(ev_ctx);
+                       return False;
+               }
        }
 
        talloc_free(fde);
@@ -106,7 +110,9 @@ static bool test_event_context(struct torture_context *test,
        close(fd[1]);
 
        while (alarm_count < fde_count+1) {
-               event_loop_once(ev_ctx);
+               if (event_loop_once(ev_ctx) == -1) {
+                       break;
+               }
        }
 
        torture_comment(test, "Got %.2f pipe events/sec\n", fde_count/timeval_elapsed(&t));