1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Use common udev_get_dev_dir() to get current device directory managed by udev.

This commit is contained in:
Peter Rajnoha 2011-04-22 12:07:35 +00:00
parent edcda01a1e
commit a1bf82a2df

View File

@ -955,13 +955,11 @@ static void _apply_settings(struct cmd_context *cmd)
static int _set_udev_checking(struct cmd_context *cmd) static int _set_udev_checking(struct cmd_context *cmd)
{ {
#ifdef UDEV_SYNC_SUPPORT #ifdef UDEV_SYNC_SUPPORT
struct udev *udev;
const char *udev_dev_dir; const char *udev_dev_dir;
size_t udev_dev_dir_len; size_t udev_dev_dir_len;
int dirs_diff; int dirs_diff;
if (!(udev = udev_new()) || if (!(udev_dev_dir = udev_get_dev_dir()) ||
!(udev_dev_dir = udev_get_dev_path(udev)) ||
!*udev_dev_dir) { !*udev_dev_dir) {
log_error("Could not get udev dev path."); log_error("Could not get udev dev path.");
return 0; return 0;
@ -988,7 +986,6 @@ static int _set_udev_checking(struct cmd_context *cmd)
init_udev_checking(0); init_udev_checking(0);
} }
udev_unref(udev);
#endif #endif
return 1; return 1;
} }