]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
event-loop: clean up some warnings
authorRay Strode <rstrode@redhat.com>
Wed, 9 Feb 2011 19:31:01 +0000 (14:31 -0500)
committerRay Strode <rstrode@redhat.com>
Wed, 9 Feb 2011 20:07:14 +0000 (15:07 -0500)
src/libply/ply-event-loop.c

index 910b0ed6bee1d7b0c58cab73efdd6b2cc942fc54..a418c4efff6c179b41299027fc9af32b388df4e0 100644 (file)
@@ -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)
     {