1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Peter Rajnoha 2016-04-01 15:35:13 +02:00
parent 15d1824fac
commit 9f28eb4c20
2 changed files with 7 additions and 6 deletions

View 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)
{
}

View File

@ -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);