diff --git a/src/libsystemd/sd-hwdb/hwdb-internal.h b/src/libsystemd/sd-hwdb/hwdb-internal.h index 9db3b31441..b26eb594ed 100644 --- a/src/libsystemd/sd-hwdb/hwdb-internal.h +++ b/src/libsystemd/sd-hwdb/hwdb-internal.h @@ -82,7 +82,7 @@ struct trie_value_entry2_f { le16_t padding; } _packed_; -#define hwdb_bin_paths \ +#define HWDB_BIN_PATHS \ "/etc/systemd/hwdb/hwdb.bin\0" \ "/etc/udev/hwdb.bin\0" \ "/usr/lib/systemd/hwdb/hwdb.bin\0" \ diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c index 11c5092bc9..588fb0313b 100644 --- a/src/libsystemd/sd-hwdb/sd-hwdb.c +++ b/src/libsystemd/sd-hwdb/sd-hwdb.c @@ -289,14 +289,14 @@ static int hwdb_new(const char *path, sd_hwdb **ret) { hwdb->n_ref = 1; - /* Find hwdb.bin in the explicit path if provided, or iterate over hwdb_bin_paths otherwise */ + /* Find hwdb.bin in the explicit path if provided, or iterate over HWDB_BIN_PATHS otherwise */ if (!isempty(path)) { log_debug("Trying to open \"%s\"...", path); hwdb->f = fopen(path, "re"); if (!hwdb->f) return log_debug_errno(errno, "Failed to open %s: %m", path); } else { - NULSTR_FOREACH(p, hwdb_bin_paths) { + NULSTR_FOREACH(p, HWDB_BIN_PATHS) { log_debug("Trying to open \"%s\"...", p); hwdb->f = fopen(p, "re"); if (hwdb->f) { diff --git a/src/shared/hwdb-util.c b/src/shared/hwdb-util.c index c99f510236..afc1f54da3 100644 --- a/src/shared/hwdb-util.c +++ b/src/shared/hwdb-util.c @@ -667,7 +667,7 @@ int hwdb_query(const char *modalias, const char *root) { assert(modalias); if (!isempty(root)) - NULSTR_FOREACH(p, hwdb_bin_paths) { + NULSTR_FOREACH(p, HWDB_BIN_PATHS) { _cleanup_free_ char *hwdb_bin = NULL; hwdb_bin = path_join(root, p); @@ -699,7 +699,7 @@ bool hwdb_should_reload(sd_hwdb *hwdb) { return false; /* if hwdb.bin doesn't exist anywhere, we need to update */ - NULSTR_FOREACH(p, hwdb_bin_paths) + NULSTR_FOREACH(p, HWDB_BIN_PATHS) if (stat(p, &st) >= 0) { found = true; break; diff --git a/src/test/test-sd-hwdb.c b/src/test/test-sd-hwdb.c index 307609ce32..7689cdf9a4 100644 --- a/src/test/test-sd-hwdb.c +++ b/src/test/test-sd-hwdb.c @@ -62,7 +62,7 @@ TEST(sd_hwdb_new_from_path) { ASSERT_RETURN_EXPECTED_SE(sd_hwdb_new_from_path("", &hwdb) == -EINVAL); assert_se(sd_hwdb_new_from_path("/path/that/should/not/exist", &hwdb) < 0); - NULSTR_FOREACH(hwdb_bin_path, hwdb_bin_paths) { + NULSTR_FOREACH(hwdb_bin_path, HWDB_BIN_PATHS) { r = sd_hwdb_new_from_path(hwdb_bin_path, &hwdb); if (r >= 0) break;