From: Jim Meyering <[email protected]>

* lcr/uis.c (lcr_uis_server): Return NULL for any poll failure
other than EINTR.  This also avoids a warning.
---
 lcr/uis.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lcr/uis.c b/lcr/uis.c
index b91312b..c5d22a3 100755
--- a/lcr/uis.c
+++ b/lcr/uis.c
@@ -153,7 +153,6 @@ static void *lcr_uis_server (void *data)
 #ifdef COROSYNC_LINUX
        int on = 1;
 #endif
-       int res;

        /*
         * Main acceptance and dispatch loop
@@ -163,7 +162,11 @@ static void *lcr_uis_server (void *data)
        ufds[0].events = POLLIN;
        ufds[1].events = POLLOUT;
        for (;;) {
-               res = poll (ufds, nfds, -1);
+               int res = poll (ufds, nfds, -1);
+               if (res == 0 || (res < 0 && errno == EINTR))
+                       continue;
+               if (res < 0)
+                       return NULL;
                if (nfds == 1 && ufds[0].revents & POLLIN) {
                        ufds[1].fd = accept (ufds[0].fd,
                                (struct sockaddr *)&un_addr, &addrlen);
@@ -177,9 +180,6 @@ static void *lcr_uis_server (void *data)
                        lcr_uis_dispatch (ufds[1].fd);
                }
        }
-
-
-       return 0;
 }

 __attribute__ ((constructor)) static int lcr_uis_ctors (void)
-- 
1.6.2.rc1.285.gc5f54

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to