diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:20:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:20:44 +0000 |
commit | ca5ecaae7a8f75e18ba85b29839752da76e3b7b9 (patch) | |
tree | 6f62ddc7fbe8ae132441a0b25e2a76e423e66e9f /src/libsystemd | |
parent | Releasing progress-linux version 256.2-1~progress7.99u1. (diff) | |
download | systemd-ca5ecaae7a8f75e18ba85b29839752da76e3b7b9.tar.xz systemd-ca5ecaae7a8f75e18ba85b29839752da76e3b7b9.zip |
Merging upstream version 256.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/meson.build | 2 | ||||
-rw-r--r-- | src/libsystemd/sd-device/device-enumerator.c | 34 |
2 files changed, 14 insertions, 22 deletions
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 6d4337d..2435492 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -118,7 +118,7 @@ libsystemd_static = static_library( libsystemd_sources, include_directories : libsystemd_includes, c_args : libsystemd_c_args, - link_with : [libbasic], + link_with : [libbasic_static], dependencies : [threads, librt, userspace], diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c index 71ab3d8..00d3328 100644 --- a/src/libsystemd/sd-device/device-enumerator.c +++ b/src/libsystemd/sd-device/device-enumerator.c @@ -701,13 +701,11 @@ static int enumerator_scan_dir_and_add_devices( dir = opendir(path); if (!dir) { - bool ignore = errno == ENOENT; + /* This is necessarily racey, so ignore missing directories */ + if (errno == ENOENT) + return 0; - /* this is necessarily racey, so ignore missing directories */ - log_debug_errno(errno, - "sd-device-enumerator: Failed to open directory %s%s: %m", - path, ignore ? ", ignoring" : ""); - return ignore ? 0 : -errno; + return log_debug_errno(errno, "sd-device-enumerator: Failed to open directory '%s': %m", path); } FOREACH_DIRENT_ALL(de, dir, return -errno) { @@ -767,12 +765,10 @@ static int enumerator_scan_dir( dir = opendir(path); if (!dir) { - bool ignore = errno == ENOENT; + if (errno == ENOENT) + return 0; - log_debug_errno(errno, - "sd-device-enumerator: Failed to open directory %s%s: %m", - path, ignore ? ", ignoring" : ""); - return ignore ? 0 : -errno; + return log_debug_errno(errno, "sd-device-enumerator: Failed to open directory '%s': %m", path); } FOREACH_DIRENT_ALL(de, dir, return -errno) { @@ -804,12 +800,10 @@ static int enumerator_scan_devices_tag(sd_device_enumerator *enumerator, const c dir = opendir(path); if (!dir) { - bool ignore = errno == ENOENT; + if (errno == ENOENT) + return 0; - log_debug_errno(errno, - "sd-device-enumerator: Failed to open directory %s%s: %m", - path, ignore ? ", ignoring" : ""); - return ignore ? 0 : -errno; + return log_debug_errno(errno, "sd-device-enumerator: Failed to open directory '%s': %m", path); } /* TODO: filter away subsystems? */ @@ -892,12 +886,10 @@ static int parent_crawl_children(sd_device_enumerator *enumerator, const char *p dir = opendir(path); if (!dir) { - bool ignore = errno == ENOENT; + if (errno == ENOENT) + return 0; - log_debug_errno(errno, - "sd-device-enumerator: Failed to open directory %s%s: %m", - path, ignore ? ", ignoring" : ""); - return ignore ? 0 : -errno; + return log_debug_errno(errno, "sd-device-enumerator: Failed to open directory '%s': %m", path); } FOREACH_DIRENT_ALL(de, dir, return -errno) { |