]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[event-loop] Store loop in fd watch structure
authorRay Strode <rstrode@redhat.com>
Sun, 15 Nov 2009 16:49:23 +0000 (11:49 -0500)
committerRay Strode <rstrode@redhat.com>
Sun, 15 Nov 2009 16:52:36 +0000 (11:52 -0500)
This will allow us to pass the watch and loop to
functions that only take one argument, without
having to create a new structure.

src/libply/ply-event-loop.c

index a6691c48f912df0d8b3c8be9d0dc91a403062ee5..45c2dd59e13e377bab63fbfb351df3f1321fe786 100644 (file)
@@ -70,6 +70,7 @@ typedef struct
 
 struct _ply_fd_watch
 {
+  ply_event_loop_t *loop;
   ply_event_destination_t *destination;
 };
 
@@ -303,11 +304,13 @@ ply_event_destination_free (ply_event_destination_t *destination)
 }
 
 static ply_fd_watch_t *
-ply_fd_watch_new (ply_event_destination_t *destination)
+ply_fd_watch_new (ply_event_loop_t        *loop,
+                  ply_event_destination_t *destination)
 {
   ply_fd_watch_t *watch;
 
   watch = calloc (1, sizeof (ply_fd_watch_t));
+  watch->loop = loop;
   watch->destination = destination;
 
   return watch;
@@ -411,7 +414,7 @@ ply_event_loop_add_destination_for_source (ply_event_loop_t        *loop,
 
   ply_event_loop_update_source_event_mask (loop, source);
 
-  watch = ply_fd_watch_new (destination);
+  watch = ply_fd_watch_new (loop, destination);
 
   ply_list_append_data (source->fd_watches, watch);