Blame SOURCES/fix-coldplug-detection.patch

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