]> sourceware.org Git - lvm2.git/commitdiff
fix: make udev_get_library_context available also for non-udev compilations
authorPeter Rajnoha <prajnoha@redhat.com>
Fri, 1 Apr 2016 13:35:13 +0000 (15:35 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Fri, 1 Apr 2016 13:35:22 +0000 (15:35 +0200)
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.

lib/misc/lvm-wrappers.c
lib/misc/lvm-wrappers.h

index e8e2e92178d501a5e3adcf0ca6bb92fcffc238a1..e2b14aa100c9dfbccd78ce611e3b844ca1ac3363 100644 (file)
@@ -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)
 {
 }
index c2d5123814c1e9df8ff9d5c047507c1be9e556f9..3c45aff8768b8ba0dfaae696917909d18ab7bc19 100644 (file)
 #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);
 
This page took 0.040183 seconds and 5 git commands to generate.