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

Peter Rajnoha prajnoha at redhat.com
Wed May 27 12:45:27 UTC 2009


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.");




More information about the lvm-devel mailing list