[ovs-dev] [PATCH 1/2] timeval: Don't require signals for time_alarm().

Ethan Jackson ethan at nicira.com
Fri Oct 5 18:14:07 UTC 2012


Thanks for the review, here's an incremental.

---
 lib/timeval.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/timeval.c b/lib/timeval.c
index 9b81cd3..835b91f 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -336,6 +336,9 @@ time_poll(struct pollfd *pollfds, int n_pollfds, long long int timeout_when,
         time_refresh();
         if (deadline <= time_msec()) {
             fatal_signal_handler(SIGALRM);
+            if (retval < 0) {
+                retval = 0;
+            }
             break;
         }
 
@@ -343,7 +346,7 @@ time_poll(struct pollfd *pollfds, int n_pollfds, long long int timeout_when,
             break;
         }
 
-        if (!blocked && deadline == LLONG_MAX) {
+        if (!blocked && !CACHE_TIME) {
             block_sigalrm(&oldsigs);
             blocked = true;
         }
-- 
1.7.12




More information about the dev mailing list