]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-rules: do not set 'issues' tag when applying rules to event device
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 13 Mar 2023 11:43:27 +0000 (20:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 13 Mar 2023 12:25:57 +0000 (21:25 +0900)
The tagging is used by `udevadm verify` and the command only parses
udev rules but not apply them.

src/udev/udev-rules.c

index 04fd608f8d4ec70860f52ccfd43ffdddae40310c..f8f9c5bae0baf6186f74432abc02982502c4a8f2 100644 (file)
@@ -196,12 +196,15 @@ struct UdevRules {
 #define log_udev_rule_internal(device, file, line_nr, level, error, fmt, ...) \
         ({                                                              \
                 int _lv = (level);                                      \
+                sd_device *_dev = (device);                             \
                 UdevRuleFile *_f = (file);                              \
                 const char *_n = _f ? _f->filename : NULL;              \
                                                                         \
-                rule_file_mark_issue(_f, _lv);                          \
+                if (!_dev && _f)                                        \
+                        _f->issues |= (1U << _lv);                      \
+                                                                        \
                 log_device_full_errno_zerook(                           \
-                                device, _lv, error, "%s:%u " fmt,       \
+                                _dev, _lv, error, "%s:%u " fmt,         \
                                 strna(_n), line_nr,                     \
                                 ##__VA_ARGS__);                         \
         })
@@ -295,11 +298,6 @@ struct UdevRules {
                              "Invalid value \"%s\" for %s (char %zu: %s), ignoring.", \
                              value, key, offset, hint)
 
-static void rule_file_mark_issue(UdevRuleFile *rule_file, uint8_t log_level) {
-        if (rule_file)
-                rule_file->issues |= (1U << log_level);
-}
-
 static void log_unknown_owner(sd_device *dev, UdevRuleLine *line, int error, const char *entity, const char *name) {
         assert(line);
         ASSERT_NON_ZERO(error);