put poll() calls in loops in case they are interrupted by signals
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Thu, 25 Jun 2009 21:12:07 +0000 (17:12 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Thu, 25 Jun 2009 21:12:07 +0000 (17:12 -0400)
libust/tracectl.c
libustcomm/ustcomm.c

index a68dc7bd7e9e4a1684d753b6be5ce9da24d4f2a5..5ccd1f5eba14b0846223f297ea78408c9af37fa0 100644 (file)
@@ -164,7 +164,8 @@ void process_blocked_consumers(void)
                idx++;
        }
 
-       result = poll(fds, n_fds, 0);
+       while((result = poll(fds, n_fds, 0)) == -1 && errno == EINTR)
+               /* nothing */;
        if(result == -1) {
                PERROR("poll");
                return;
index 225d1990be042a18cf0cde7c297e92c61b48c386..0a5ab6aaaf1110d8e66a44b123f81f4d9829c878 100644 (file)
@@ -272,7 +272,8 @@ int ustcomm_recv_message(struct ustcomm_server *server, char **msg, struct ustco
                        idx++;
                }
 
-               result = poll(fds, n_fds, timeout);
+               while((result = poll(fds, n_fds, timeout)) == -1 && errno == EINTR)
+                       /* nothing */;
                if(result == -1) {
                        PERROR("poll");
                        return -1;
This page took 0.032216 seconds and 4 git commands to generate.