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

[lvm-devel] [PATCH 3/3] Use global libudev context in _set_udev_checking fn



This is just a little cleanup - we use global libudev reference now,
so there's no need to call udev_new even in existing code. Udev library
reference is initialized at LVM2 start and finalized at its end
(see previous patch).

Peter
---
 tools/lvmcmdline.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index efe7f4e..aef9bf8 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -960,7 +960,7 @@ static int _set_udev_checking(struct cmd_context *cmd)
 	size_t udev_dev_dir_len;
 	int dirs_diff;
 
-	if (!(udev = udev_new()) ||
+	if (!(udev = udev_get_library_context()) ||
 	    !(udev_dev_dir = udev_get_dev_path(udev)) ||
 	    !*udev_dev_dir) {
 		log_error("Could not get udev dev path.");
@@ -988,7 +988,6 @@ static int _set_udev_checking(struct cmd_context *cmd)
 		init_udev_checking(0);
 	}
 
-	udev_unref(udev);
 #endif
 	return 1;
 }


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