From: Peter Rajnoha Date: Fri, 1 Apr 2016 13:35:13 +0000 (+0200) Subject: fix: make udev_get_library_context available also for non-udev compilations X-Git-Tag: v2_02_149~3 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=9f28eb4c20ecb772f1b8a912c43f243d63a7e5f3;p=lvm2.git fix: make udev_get_library_context available also for non-udev compilations If compiling without udev_sync support, udev_get_library_context simply returns NULL so we don't need to remember putting ifdef UDEV_SYNC_SUPPORT in the code all the time we just need to check whether there's any udev context initialized or not. --- diff --git a/lib/misc/lvm-wrappers.c b/lib/misc/lvm-wrappers.c index e8e2e9217..e2b14aa10 100644 --- a/lib/misc/lvm-wrappers.c +++ b/lib/misc/lvm-wrappers.c @@ -66,7 +66,7 @@ bad: return 0; } -struct udev* udev_get_library_context(void) +void *udev_get_library_context(void) { return _udev; } @@ -78,6 +78,11 @@ int udev_init_library_context(void) return 1; } +void *udev_get_library_context(void) +{ + return NULL; +} + void udev_fin_library_context(void) { } diff --git a/lib/misc/lvm-wrappers.h b/lib/misc/lvm-wrappers.h index c2d512381..3c45aff87 100644 --- a/lib/misc/lvm-wrappers.h +++ b/lib/misc/lvm-wrappers.h @@ -16,12 +16,8 @@ #ifndef _LVM_WRAPPERS_H #define _LVM_WRAPPERS_H -#ifdef UDEV_SYNC_SUPPORT -struct udev; -struct udev *udev_get_library_context(void); -#endif - int udev_init_library_context(void); +void *udev_get_library_context(void); void udev_fin_library_context(void); int udev_is_running(void);