X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fsimple-watch.c;h=c970c3c4afdb5fedd9d2f1d5aaa9f17889bb5d70;hb=b177bc98ac5b0e8b59f00becffadda7ceeb32553;hp=36335215088f2f0563e5e377e496cb0044010e8d;hpb=11fdf8612c684b0faf85781ef1b2766bf6ea1f0b;p=catta diff --git a/avahi-common/simple-watch.c b/avahi-common/simple-watch.c index 3633521..c970c3c 100644 --- a/avahi-common/simple-watch.c +++ b/avahi-common/simple-watch.c @@ -523,17 +523,13 @@ int avahi_simple_poll_run(AvahiSimplePoll *s) { s->state = STATE_RUNNING; - if (s->prepared_timeout != 0) { - - if (s->poll_func(s->pollfds, s->n_pollfds, s->prepared_timeout, s->poll_func_userdata) < 0) { - s->state = STATE_FAILURE; - return -1; - } + if (s->poll_func(s->pollfds, s->n_pollfds, s->prepared_timeout, s->poll_func_userdata) < 0) { + s->state = STATE_FAILURE; + return -1; + } - /* The poll events are now valid again */ - s->events_valid = 1; - } else - s->events_valid = 0; + /* The poll events are now valid again */ + s->events_valid = 1; /* Update state */ s->state = STATE_RAN; @@ -619,7 +615,7 @@ const AvahiPoll* avahi_simple_poll_get(AvahiSimplePoll *s) { return &s->api; } -static int system_poll(struct pollfd *ufds, unsigned int nfds, int timeout, void *userdata) { +static int system_poll(struct pollfd *ufds, unsigned int nfds, int timeout, AVAHI_GCC_UNUSED void *userdata) { return poll(ufds, nfds, timeout); } @@ -640,5 +636,6 @@ int avahi_simple_poll_loop(AvahiSimplePoll *s) { for (;;) if ((r = avahi_simple_poll_iterate(s, -1)) != 0) - return r; + if (r >= 0 || errno != EINTR) + return r; }