diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-06-25 23:35:01 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-06-25 23:35:01 +0200 |
commit | 72223abd8a3b53f539e020b354bdfbbfc579473d (patch) | |
tree | 1b1e51421110818a590db50d4ca1a5fc6d197002 /avahi-common | |
parent | 2ff4904f525f4237011badeb3dbcf6aaf7f97db2 (diff) |
watch: ignore EINTR in the main loop
Diffstat (limited to 'avahi-common')
-rw-r--r-- | avahi-common/simple-watch.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/avahi-common/simple-watch.c b/avahi-common/simple-watch.c index 56c2ccb..8df18dd 100644 --- a/avahi-common/simple-watch.c +++ b/avahi-common/simple-watch.c @@ -521,9 +521,19 @@ int avahi_simple_poll_run(AvahiSimplePoll *s) { s->state = STATE_RUNNING; - if (s->poll_func(s->pollfds, s->n_pollfds, s->prepared_timeout, s->poll_func_userdata) < 0) { - s->state = STATE_FAILURE; - return -1; + for (;;) { + errno = 0; + + if (s->poll_func(s->pollfds, s->n_pollfds, s->prepared_timeout, s->poll_func_userdata) < 0) { + + if (errno == EINTR) + continue; + + s->state = STATE_FAILURE; + return -1; + } + + break; } /* The poll events are now valid again */ |