diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-09-27 18:04:06 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-03 11:55:36 -0700 |
commit | fad04dd9701aa76249a0bab31676103debb84307 (patch) | |
tree | a4b690eeede6f1f610918d3295b715eb406fefab /config/udev.c | |
parent | 77743f877d573cdf70fcb5cb5897250f668ebf9b (diff) |
udev: make use of udev_enumerate_add_match_tag() only when it is available
udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag()
are mostly optimizations, hence simply skip these calls if they are not
available in the installed version of libudev.
This should fix the build on older versions of udev.
[airlied: fixes tinderbox failures on RHEL6]
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'config/udev.c')
-rw-r--r-- | config/udev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/udev.c b/config/udev.c index 1ba0d500d..e2b3726cc 100644 --- a/config/udev.c +++ b/config/udev.c @@ -285,8 +285,10 @@ config_udev_init(void) udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input", NULL); udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); /* For Wacom serial devices */ +#ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG if (SeatId && strcmp(SeatId, "seat0")) udev_monitor_filter_add_match_tag(udev_monitor, SeatId); +#endif if (udev_monitor_enable_receiving(udev_monitor)) { ErrorF("config/udev: failed to bind the udev monitor\n"); @@ -300,8 +302,10 @@ config_udev_init(void) udev_enumerate_add_match_subsystem(enumerate, "input"); udev_enumerate_add_match_subsystem(enumerate, "tty"); +#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG if (SeatId && strcmp(SeatId, "seat0")) udev_enumerate_add_match_tag(enumerate, SeatId); +#endif udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); |