Revert "udev_rules_parse_file: do not skip ENOENT"

This reverts commit 42a467b552.

We need to skip -ENOENT when loading udev rules because new files with rules
may be added or removed at any time, and the loading of rules is triggered
asynchronously. Even though the window is fairly narrow, udev shouldn't throw
an error if a rules file is removed.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-03-28 18:42:24 +02:00
parent 201423d801
commit 9db7081d83
+5 -1
View File
@@ -1436,8 +1436,12 @@ int udev_rules_parse_file(UdevRules *rules, const char *filename, bool extra_che
assert(filename);
f = fopen(filename, "re");
if (!f)
if (!f) {
if (errno == ENOENT)
return 0;
return log_warning_errno(errno, "Failed to open %s, ignoring: %m", filename);
}
if (fstat(fileno(f), &st) < 0)
return log_warning_errno(errno, "Failed to stat %s, ignoring: %m", filename);