summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-02-18 16:02:45 +0100
committerGitHub <noreply@github.com>2019-02-18 16:02:45 +0100
commitbde06abd4f3febc149bf137ca68e4abaa2975b4d (patch)
treeb6deea79edbe38bf425e75f46d098325d5dde187 /src/udev/udev-rules.c
parentMerge pull request #11729 from yuwata/fix-11721 (diff)
parentcore: update comment (diff)
downloadsystemd-bde06abd4f3febc149bf137ca68e4abaa2975b4d.tar.xz
systemd-bde06abd4f3febc149bf137ca68e4abaa2975b4d.zip
Merge pull request #10408 from keszybz/analyze-cat-presets
systemd-analyze cat-presets
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index ce787786a6..e34ecc6ee9 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -15,6 +15,7 @@
#include "alloc-util.h"
#include "conf-files.h"
+#include "def.h"
#include "device-private.h"
#include "device-util.h"
#include "dirent-util.h"
@@ -41,6 +42,7 @@
#include "util.h"
#define PREALLOC_TOKEN 2048
+#define RULES_DIRS (const char* const*) CONF_PATHS_STRV("udev/rules.d")
struct uid_gid {
unsigned name_off;
@@ -50,13 +52,6 @@ struct uid_gid {
};
};
-static const char* const rules_dirs[] = {
- "/etc/udev/rules.d",
- "/run/udev/rules.d",
- UDEVLIBEXECDIR "/rules.d",
- NULL
-};
-
struct UdevRules {
usec_t dirs_ts_usec;
ResolveNameTiming resolve_name_timing;
@@ -1591,7 +1586,7 @@ int udev_rules_new(UdevRules **ret_rules, ResolveNameTiming resolve_name_timing)
udev_rules_check_timestamp(rules);
- r = conf_files_list_strv(&files, ".rules", NULL, 0, rules_dirs);
+ r = conf_files_list_strv(&files, ".rules", NULL, 0, RULES_DIRS);
if (r < 0)
return log_error_errno(r, "Failed to enumerate rules files: %m");
@@ -1643,7 +1638,7 @@ bool udev_rules_check_timestamp(UdevRules *rules) {
if (!rules)
return false;
- return paths_check_timestamp(rules_dirs, &rules->dirs_ts_usec, true);
+ return paths_check_timestamp(RULES_DIRS, &rules->dirs_ts_usec, true);
}
static bool match_key(UdevRules *rules, struct token *token, const char *val) {