]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
add error handling when polling (FDO Bug #12954)
authorJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 18:46:50 +0000 (13:46 -0500)
committerJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 18:46:50 +0000 (13:46 -0500)
2008-01-15  John (J5) Palmieri  <johnp@redhat.com>

* patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>

* dbus/dbus-spawn.c (babysit, babysitter_iteration): add error
handling when polling (FDO Bug #12954)

ChangeLog
dbus/dbus-spawn.c

index 58c63bc28fba6b4e5c0bf1aecd80b91da21951e3..247c09e7b53aab44bae6f8bc3d2e146d9b9f7422 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-15  John (J5) Palmieri  <johnp@redhat.com>
+
+       * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
+
+       * dbus/dbus-spawn.c (babysit, babysitter_iteration): add error
+       handling when polling (FDO Bug #12954) 
+
 2008-01-15  John (J5) Palmieri  <johnp@redhat.com>
 
        * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
index eaa9ef156c1849936b4075dc809d943709f9082d..68596cf3d1214c07aaa7eac29dd479242ba46523 100644 (file)
@@ -552,10 +552,21 @@ babysitter_iteration (DBusBabysitter *sitter,
     {
       int ret;
 
-      ret = _dbus_poll (fds, i, 0);
+      do
+        {
+          ret = _dbus_poll (fds, i, 0);
+        }
+      while (ret < 0 && errno == EINTR);
+
       if (ret == 0 && block)
-        ret = _dbus_poll (fds, i, -1);
-      
+        {
+          do
+            {
+              ret = _dbus_poll (fds, i, -1);
+            }
+          while (ret < 0 && errno == EINTR);
+        }
+
       if (ret > 0)
         {
           descriptors_ready = TRUE;
@@ -1018,7 +1029,11 @@ babysit (pid_t grandchild_pid,
       pfds[1].events = _DBUS_POLLIN;
       pfds[1].revents = 0;
       
-      _dbus_poll (pfds, _DBUS_N_ELEMENTS (pfds), -1);
+      if (_dbus_poll (pfds, _DBUS_N_ELEMENTS (pfds), -1) < 0 && errno != EINTR)
+        {
+          _dbus_warn ("_dbus_poll() error: %s\n", strerror (errno));
+          exit (1);
+        }
 
       if (pfds[0].revents != 0)
         {