diff src/aosd/ghosd-main.c @ 573:f574c2c52beb trunk

[svn] - aosd: modified ghosd library source to ignore EINTR when polling
author giacomo
date Mon, 29 Jan 2007 08:38:56 -0800
parents d401f87f89f7
children 6584e697e6da
line wrap: on
line diff
--- a/src/aosd/ghosd-main.c	Mon Jan 29 07:50:26 2007 -0800
+++ b/src/aosd/ghosd-main.c	Mon Jan 29 08:38:56 2007 -0800
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "ghosd.h"
 #include "ghosd-internal.h"
@@ -70,8 +71,12 @@
     struct pollfd pollfd = { ghosd_get_socket(ghosd), POLLIN, 0 };
     int ret = poll(&pollfd, 1, dt);
     if (ret < 0) {
-      perror("poll");
-      exit(1);
+      if ( errno != EINTR )
+      {
+        perror("poll");
+        exit(1);
+      }
+      /* else go on, ignore EINTR */
     } else if (ret > 0) {
       ghosd_main_iterations(ghosd);
     } else {