diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-30 12:18:52 -0700 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-30 12:18:52 -0700 |
| commit | 88f3bd84c8ea8f0b3526f970388ef76baa231fe2 (patch) | |
| tree | 44eb904fbc253aae8738b947c484fd5c1a2ec83b /src/event-loop.c | |
| parent | Use non-blocking timerfd to prevent blocking when updating timer event sources (diff) | |
| download | wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.tar wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.tar.gz wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.tar.bz2 wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.tar.lz wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.tar.xz wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.tar.zst wayland-88f3bd84c8ea8f0b3526f970388ef76baa231fe2.zip | |
Avoid printing to stderr
Use wl_log in the last few places where we print to stderr. Remove
logging in a couple of places where we properly return an error code.
https://bugs.freedesktop.org/show_bug.cgi?id=73339
Diffstat (limited to 'src/event-loop.c')
| -rw-r--r-- | src/event-loop.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/event-loop.c b/src/event-loop.c index 1046600..9790cde 100644 --- a/src/event-loop.c +++ b/src/event-loop.c @@ -97,7 +97,6 @@ add_source(struct wl_event_loop *loop, struct epoll_event ep; if (source->fd < 0) { - fprintf(stderr, "could not add source\n: %m"); free(source); return NULL; } @@ -175,7 +174,7 @@ wl_event_source_timer_dispatch(struct wl_event_source *source, len = read(source->fd, &expires, sizeof expires); if (!(len == -1 && errno == EAGAIN) && len != sizeof expires) /* Is there anything we can do here? Will this ever happen? */ - fprintf(stderr, "timerfd read error: %m\n"); + wl_log("timerfd read error: %m\n"); return timer_source->func(timer_source->base.data); } @@ -212,10 +211,8 @@ wl_event_source_timer_update(struct wl_event_source *source, int ms_delay) its.it_interval.tv_nsec = 0; its.it_value.tv_sec = ms_delay / 1000; its.it_value.tv_nsec = (ms_delay % 1000) * 1000 * 1000; - if (timerfd_settime(source->fd, 0, &its, NULL) < 0) { - fprintf(stderr, "could not set timerfd\n: %m"); + if (timerfd_settime(source->fd, 0, &its, NULL) < 0) return -1; - } return 0; } @@ -238,7 +235,7 @@ wl_event_source_signal_dispatch(struct wl_event_source *source, len = read(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"); + wl_log("signalfd read error: %m\n"); return signal_source->func(signal_source->signal_number, signal_source->base.data); |
