diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2008-01-15 13:46:50 -0500 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2008-01-15 13:46:50 -0500 |
commit | a6a22beeae1e710d211d773d78e21c95f4ebe536 (patch) | |
tree | af4e5f6eb75f806aa72148986b06a42f736d591e /dbus | |
parent | f72bb380a663a2af6af6ea8edbc1a783086f53cd (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)
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-spawn.c | 23 |
1 files changed, 19 insertions, 4 deletions
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) { |