summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-01-15 13:46:50 -0500
committerJohn (J5) Palmieri <johnp@redhat.com>2008-01-15 13:46:50 -0500
commita6a22beeae1e710d211d773d78e21c95f4ebe536 (patch)
treeaf4e5f6eb75f806aa72148986b06a42f736d591e
parentf72bb380a663a2af6af6ea8edbc1a783086f53cd (diff)
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> * dbus/dbus-spawn.c (babysit, babysitter_iteration): add error handling when polling (FDO Bug #12954)
-rw-r--r--ChangeLog7
-rw-r--r--dbus/dbus-spawn.c23
2 files changed, 26 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 58c63bc2..247c09e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
* 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>
+
* bus/config-parser.c (locate_attributes): remove dead code which
always evaluated to TRUE
diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c
index eaa9ef15..68596cf3 100644
--- a/dbus/dbus-spawn.c
+++ b/dbus/dbus-spawn.c
@@ -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)
{