alaurie / rpms / plymouth

Forked from rpms/plymouth 4 days ago
Clone
01552a
From 3d38bbb09383a634c78722c7bf18a3e1a3f36647 Mon Sep 17 00:00:00 2001
01552a
From: Frederic Crozat <fcrozat@suse.com>
01552a
Date: Thu, 19 Jun 2014 17:58:50 +0200
01552a
Subject: [PATCH] libply-splash-core: also monitor for file removal in udev
01552a
 directory
01552a
01552a
Ensure plymouth detects coldplug completion with recent udev (>= 213).
01552a
---
01552a
 src/libply-splash-core/ply-device-manager.c | 2 +-
01552a
 1 file changed, 1 insertion(+), 1 deletion(-)
01552a
01552a
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
01552a
index a7890d0..5766bcb 100644
01552a
--- a/src/libply-splash-core/ply-device-manager.c
01552a
+++ b/src/libply-splash-core/ply-device-manager.c
01552a
@@ -780,61 +780,61 @@ on_udev_queue_changed (ply_device_manager_t *manager)
01552a
 
01552a
   ply_trace ("udev coldplug complete");
01552a
   ply_event_loop_stop_watching_fd (manager->loop, manager->udev_queue_fd_watch);
01552a
   manager->udev_queue_fd_watch = NULL;
01552a
   udev_queue_unref (manager->udev_queue);
01552a
 
01552a
   close (manager->udev_queue_fd);
01552a
   manager->udev_queue_fd = -1;
01552a
 
01552a
   manager->udev_queue = NULL;
01552a
 
01552a
   create_seats_from_udev (manager);
01552a
 }
01552a
 
01552a
 static void
01552a
 watch_for_coldplug_completion (ply_device_manager_t *manager)
01552a
 {
01552a
   int fd;
01552a
   int result;
01552a
 
01552a
   manager->udev_queue = udev_queue_new (manager->udev_context);
01552a
 
01552a
   if (udev_queue_get_queue_is_empty (manager->udev_queue))
01552a
     {
01552a
       ply_trace ("udev coldplug completed already ");
01552a
       create_seats_from_udev (manager);
01552a
       return;
01552a
     }
01552a
 
01552a
   fd = inotify_init1 (IN_CLOEXEC);
01552a
-  result = inotify_add_watch (fd, "/run/udev", IN_MOVED_TO);
01552a
+  result = inotify_add_watch (fd, "/run/udev", IN_MOVED_TO| IN_DELETE);
01552a
 
01552a
   if (result < 0)
01552a
     {
01552a
       ply_trace ("could not watch for udev to show up: %m");
01552a
       close (fd);
01552a
 
01552a
       create_fallback_seat (manager);
01552a
       return;
01552a
     }
01552a
 
01552a
   manager->udev_queue_fd = fd;
01552a
 
01552a
   manager->udev_queue_fd_watch = ply_event_loop_watch_fd (manager->loop,
01552a
                                                           fd,
01552a
                                                           PLY_EVENT_LOOP_FD_STATUS_HAS_DATA,
01552a
                                                           (ply_event_handler_t)
01552a
                                                           on_udev_queue_changed,
01552a
                                                           NULL,
01552a
                                                           manager);
01552a
 
01552a
 }
01552a
 
01552a
 void
01552a
 ply_device_manager_watch_seats (ply_device_manager_t       *manager,
01552a
                                 ply_seat_added_handler_t    seat_added_handler,
01552a
                                 ply_seat_removed_handler_t  seat_removed_handler,
01552a
                                 void                       *data)
01552a
 {
01552a
   bool done_with_initial_seat_setup;
01552a
 
01552a
-- 
01552a
2.3.7
01552a