From: Yu Watanabe Date: Mon, 13 Mar 2023 11:43:27 +0000 (+0900) Subject: udev-rules: do not set 'issues' tag when applying rules to event device X-Git-Tag: v254-rc1~1037^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2aa5fe5e326e25da800ea86a431e71322a4f4ec1;p=thirdparty%2Fsystemd.git udev-rules: do not set 'issues' tag when applying rules to event device The tagging is used by `udevadm verify` and the command only parses udev rules but not apply them. --- diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 04fd608f8d4..f8f9c5bae0b 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -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);