We usually use upper letters for constant definitions.
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" \
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) {
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);
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;
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;