summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e52a8c6)
Now that we're handing non-fatal signals (i.e., SIGCHLD in the process
lib), we need to gracefully handle -EINTR from poll().
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <sys/time.h>
#include <talloc/talloc.h>
#include <sys/time.h>
#include <talloc/talloc.h>
rc = poll(set->pollfds, set->n_io_waiters, timeout_ms);
rc = poll(set->pollfds, set->n_io_waiters, timeout_ms);
+ if (rc < 0) {
+ if (errno == EINTR)
+ rc = 0;
for (i = 0; i < set->n_io_waiters; i++) {
struct waiter *waiter = set->io_waiters[i];
for (i = 0; i < set->n_io_waiters; i++) {
struct waiter *waiter = set->io_waiters[i];
while (1) {
int result = waiter_poll(cui->waitset);
while (1) {
int result = waiter_poll(cui->waitset);
- if (result < 0 && errno != EINTR) {
pb_log("%s: poll: %s\n", __func__, strerror(errno));
break;
}
pb_log("%s: poll: %s\n", __func__, strerror(errno));
break;
}
while (1) {
int result = waiter_poll(client->waitset);
while (1) {
int result = waiter_poll(client->waitset);
- if (result < 0 && errno != EINTR) {
pb_log("%s: poll: %s\n", __func__, strerror(errno));
break;
}
pb_log("%s: poll: %s\n", __func__, strerror(errno));
break;
}