diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-08-12 16:23:07 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-08-12 16:25:18 -0400 |
commit | efeb9e977885c2df3426346ec45a913ff403af8d (patch) | |
tree | f94e98f2f94602abb99fcc4250b32beb140178b9 | |
parent | f2665e21ce3f524bfacd6837f95acdee5f3903db (diff) |
event-loop: Quiet a few warnings
There's no good error recovery possible in these cases though.
-rw-r--r-- | src/event-loop.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/event-loop.c b/src/event-loop.c index 615ec1d..5bd52fd 100644 --- a/src/event-loop.c +++ b/src/event-loop.c @@ -162,8 +162,12 @@ wl_event_source_timer_dispatch(struct wl_event_source *source, struct wl_event_source_timer *timer_source = (struct wl_event_source_timer *) source; uint64_t expires; + int len; - read(timer_source->fd, &expires, sizeof expires); + len = read(timer_source->fd, &expires, sizeof expires); + if (len != sizeof expires) + /* Is there anything we can do here? Will this ever happen? */ + fprintf(stderr, "timerfd read error: %m\n"); return timer_source->func(timer_source->base.data); } @@ -256,8 +260,12 @@ wl_event_source_signal_dispatch(struct wl_event_source *source, struct wl_event_source_signal *signal_source = (struct wl_event_source_signal *) source; struct signalfd_siginfo signal_info; + int len; - read(signal_source->fd, &signal_info, sizeof signal_info); + len = read(signal_source->fd, &signal_info, sizeof signal_info); + if (len != sizeof signal_info) + /* Is there anything we can do here? Will this ever happen? */ + fprintf(stderr, "signalfd read error: %m\n"); return signal_source->func(signal_source->signal_number, signal_source->base.data); |