]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
It seems that some older udev versions support filtering but not
authorRoy Marples <roy@marples.name>
Thu, 12 Sep 2013 21:43:17 +0000 (21:43 +0000)
committerRoy Marples <roy@marples.name>
Thu, 12 Sep 2013 21:43:17 +0000 (21:43 +0000)
per device initialization checks.
Add a test for this.

configure
dev/udev.c

index dbd4c6f748467a83df5851c05652e17db55670ed..c54028ad086ae1d9f088119390d52c8b63d30ddc 100755 (executable)
--- a/configure
+++ b/configure
@@ -634,6 +634,24 @@ EOF
                echo "no"
        fi
        rm -f _udev.c _udev
+
+       printf "Checking udev_device_get_is_initialized ... "
+       cat <<EOF >_udev.c
+#include <libudev.h>
+#include <stdlib.h>
+int main(void) {
+       udev_device_get_is_initialized(NULL);
+       return 0;
+}
+EOF
+       if $XCC $LIBUDEV_CFLAGS _udev.c -o _udev $LIBUDEV_LIBS 2>/dev/null
+       then
+               echo "yes"
+       else
+               echo "LIBUDEV_CPPFLAGS+=        -DLIBUDEV_NOINIT" >>$CONFIG_MK
+               echo "no"
+       fi
+       rm -f _udev.c _udev
 elif [ "$DEV" != no -a "$UDEV" != no ]; then
        echo "no"
 fi
index 52562c06d05717cca95eef21c10d4bc5733b1540..4f9450e81193bee05e8339981306acce2653dbfe 100644 (file)
@@ -62,7 +62,7 @@ udev_initialized(const char *ifname)
 
        device = udev_device_new_from_subsystem_sysname(udev, "net", ifname);
        if (device) {
-#ifndef LIBUDEV_NOFILTER
+#ifndef LIBUDEV_NOINIT
                r = udev_device_get_is_initialized(device);
 #else
                r = 1;