X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fsimple-watch.c;h=c970c3c4afdb5fedd9d2f1d5aaa9f17889bb5d70;hb=c9acf48b993f5d49e57da1fda301350146acc630;hp=2a15c5effba9bf26a597052bf6039fb5dc7f7375;hpb=9da0241b9c1bf751605ba11fa6d4c75e34fe5f2b;p=catta diff --git a/avahi-common/simple-watch.c b/avahi-common/simple-watch.c index 2a15c5e..c970c3c 100644 --- a/avahi-common/simple-watch.c +++ b/avahi-common/simple-watch.c @@ -31,9 +31,9 @@ #include #include -#include -#include - +#include "llist.h" +#include "malloc.h" +#include "timeval.h" #include "simple-watch.h" struct AvahiWatch { @@ -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; }