diff options
Diffstat (limited to '')
-rw-r--r-- | src/libudev/libudev-device.c | 3 | ||||
-rw-r--r-- | src/libudev/test-libudev.c | 3 | ||||
-rw-r--r-- | src/libudev/test-udev-device-thread.c | 7 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index 7b9f54c..50e2459 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* Make sure the net/if.h header is included before any linux/ one */ +#include <net/if.h> #include <ctype.h> #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <linux/sockios.h> -#include <net/if.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> diff --git a/src/libudev/test-libudev.c b/src/libudev/test-libudev.c index e05a062..99934c6 100644 --- a/src/libudev/test-libudev.c +++ b/src/libudev/test-libudev.c @@ -339,6 +339,9 @@ static void test_hwdb(struct udev *udev, const char *modalias) { if (!hwdb) log_warning_errno(errno, "Failed to open hwdb: %m"); + SAVE_ASSERT_RETURN_IS_CRITICAL; + log_set_assert_return_is_critical(hwdb); + udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, modalias, 0)) log_info("'%s'='%s'", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry)); diff --git a/src/libudev/test-udev-device-thread.c b/src/libudev/test-udev-device-thread.c index c082fdc..fdf0818 100644 --- a/src/libudev/test-udev-device-thread.c +++ b/src/libudev/test-udev-device-thread.c @@ -6,6 +6,7 @@ #include <stdlib.h> #include "libudev.h" +#include "tests.h" #define handle_error_errno(error, msg) \ ({ \ @@ -29,8 +30,12 @@ int main(int argc, char *argv[]) { int r; loopback = udev_device_new_from_syspath(NULL, "/sys/class/net/lo"); - if (!loopback) + if (!loopback) { + if (errno == ENODEV) + return log_tests_skipped_errno(errno, "Loopback device not found"); + return handle_error_errno(errno, "Failed to create loopback device object"); + } entry = udev_device_get_properties_list_entry(loopback); udev_list_entry_foreach(e, entry) |