From: Erik Skultety Date: Wed, 31 May 2017 09:31:29 +0000 (+0200) Subject: udev: Fix build on older platforms X-Git-Tag: v3.4.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5970b1398218cd7eb242c4708221dd12bfe6aa0d;p=thirdparty%2Flibvirt.git udev: Fix build on older platforms Caused by commit @d1eea6c1 due to the missing symbol on older platforms. Signed-off-by: Erik Skultety --- diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4 index 85ca2cb1a3..be7dba5d2d 100644 --- a/m4/virt-udev.m4 +++ b/m4/virt-udev.m4 @@ -34,6 +34,14 @@ AC_DEFUN([LIBVIRT_CHECK_UDEV],[ if test "$with_udev_logging" = "yes" ; then AC_DEFINE_UNQUOTED([HAVE_UDEV_LOGGING], 1, [whether libudev logging can be used]) fi + + old_CFLAGS="$CFLAGS" + old_LIBS="$LIBS" + CFLAGS="$CFLAGS $UDEV_CFLAGS" + LIBS="$CFLAGS $UDEV_LIBS" + AC_CHECK_FUNCS([udev_monitor_set_receive_buffer_size]) + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" fi ]) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index a69dc11753..01438ea170 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1764,12 +1764,14 @@ static int nodeStateInitialize(bool privileged, udev_monitor_enable_receiving(priv->udev_monitor); +#if HAVE_UDEV_MONITOR_SET_RECEIVE_BUFFER_SIZE /* mimic udevd's behaviour and override the systems rmem_max limit in case * there's a significant number of device 'add' events */ if (geteuid() == 0) udev_monitor_set_receive_buffer_size(priv->udev_monitor, 128 * 1024 * 1024); +#endif /* We register the monitor with the event callback so we are * notified by udev of device changes before we enumerate existing