All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 3/3] Use global libudev context in _set_udev_checking fn
Date: Mon, 21 Mar 2011 15:46:08 +0100	[thread overview]
Message-ID: <4D8764B0.6060706@redhat.com> (raw)

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;
 }



             reply	other threads:[~2011-03-21 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 14:46 Peter Rajnoha [this message]
2011-03-21 15:48 ` [PATCH 3/3] Use global libudev context in _set_udev_checking fn Milan Broz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D8764B0.6060706@redhat.com \
    --to=prajnoha@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.