sysupdate: some smaller clean-ups

Nothing earth shattering, just some minor tweaks.
This commit is contained in:
Lennart Poettering
2026-06-22 14:42:30 +02:00
parent 180893f9d7
commit 39ff56374c
3 changed files with 8 additions and 7 deletions
+4 -2
View File
@@ -6,7 +6,9 @@
#include "shared-forward.h" /* IWYU pragma: export */
typedef struct Context Context;
typedef struct PartitionInfo PartitionInfo;
typedef struct Resource Resource;
typedef struct Instance Instance;
typedef struct InstanceMetadata InstanceMetadata;
typedef struct PartitionInfo PartitionInfo;
typedef struct Resource Resource;
typedef struct Transfer Transfer;
typedef struct UpdateSet UpdateSet;
+1 -1
View File
@@ -458,7 +458,7 @@ int pattern_match_many(char **patterns, const char *s, InstanceMetadata *ret) {
r = pattern_match(*p, s, &found);
if (r < 0)
return r;
if (r > 0) {
if (r != PATTERN_MATCH_NO) {
if (ret) {
*ret = found;
found = (InstanceMetadata) INSTANCE_METADATA_NULL;
+3 -4
View File
@@ -158,6 +158,8 @@ static int resource_load_from_directory_recursive(
return log_oom();
r = pattern_match_many(rr->patterns, rel_joined_for_matching, &extracted_fields);
if (r < 0)
return log_error_errno(r, "Failed to match pattern: %m");
if (r == PATTERN_MATCH_RETRY) {
_cleanup_closedir_ DIR *subdir = NULL;
@@ -170,10 +172,7 @@ static int resource_load_from_directory_recursive(
return r;
if (r == 0)
continue;
}
else if (r < 0)
return log_error_errno(r, "Failed to match pattern: %m");
else if (r == PATTERN_MATCH_NO)
} else if (r == PATTERN_MATCH_NO)
continue;
if (de->d_type == DT_DIR && m != S_IFDIR)