[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 3/9] Udev integration: add semaphore IPC to wait for udev rule completion



We should set the cookie value to 0 if the notification is disabled!

Peter

diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index ef249dc..d24584d 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -794,8 +794,10 @@ int dm_udev_notif_sem_open(uint32_t *cookie)
 	int fd;
 	uint32_t gen_cookie;
 
-	if (!dm_udev_notif_is_enabled() || !dm_cookie_supported())
+	if (!dm_udev_notif_is_enabled() || !dm_cookie_supported()) {
+		*cookie = 0;
 		return 1;
+	}
 
 	if ((fd = open("/dev/urandom", O_RDONLY)) < 0) {
 		log_error("Failed to open /dev/urandom to create random cookie value.");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]