From: Ray Strode Date: Wed, 9 Feb 2011 19:31:01 +0000 (-0500) Subject: event-loop: clean up some warnings X-Git-Tag: 0.8.4~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc2ca3959594f0c274e542be01d57654deaff8d9;p=thirdparty%2Fplymouth.git event-loop: clean up some warnings --- diff --git a/src/libply/ply-event-loop.c b/src/libply/ply-event-loop.c index 910b0ed6..a418c4ef 100644 --- a/src/libply/ply-event-loop.c +++ b/src/libply/ply-event-loop.c @@ -378,7 +378,6 @@ ply_event_loop_update_source_event_mask (ply_event_loop_t *loop, { ply_list_node_t *node; struct epoll_event event = { 0 }; - int status; assert (loop != NULL); assert (source != NULL); @@ -410,7 +409,12 @@ ply_event_loop_update_source_event_mask (ply_event_loop_t *loop, if (source->is_getting_polled) { + int status; + status = epoll_ctl (loop->epoll_fd, EPOLL_CTL_MOD, source->fd, &event); + + if (status < 0) + ply_trace ("failed to modify epoll event mask for fd %d: %m", source->fd); } } @@ -637,7 +641,6 @@ ply_event_loop_remove_source_node (ply_event_loop_t *loop, ply_list_node_t *source_node) { ply_event_source_t *source; - int status; source = (ply_event_source_t *) ply_list_node_get_data (source_node); @@ -645,7 +648,12 @@ ply_event_loop_remove_source_node (ply_event_loop_t *loop, if (source->is_getting_polled) { + int status; + status = epoll_ctl (loop->epoll_fd, EPOLL_CTL_DEL, source->fd, NULL); + + if (status < 0) + ply_trace ("failed to delete fd %d from epoll watch list: %m", source->fd); source->is_getting_polled = false; } @@ -676,9 +684,7 @@ ply_event_loop_free_sources (ply_event_loop_t *loop) while (node != NULL) { ply_list_node_t *next_node; - ply_event_source_t *source; - source = (ply_event_source_t *) ply_list_node_get_data (node); next_node = ply_list_get_next_node (loop->sources, node); ply_event_loop_remove_source_node (loop, node); node = next_node; @@ -1121,11 +1127,9 @@ static void ply_event_loop_free_timeout_watches (ply_event_loop_t *loop) { ply_list_node_t *node; - double now; assert (loop != NULL); - now = ply_get_timestamp (); node = ply_list_get_first_node (loop->timeout_watches); while (node != NULL) {