1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00

udevadm: ignore -ENODEV on trigger

The commit 88da55e28b erroneously makes
`udevadm trigger` treat -ENODEV error critical.
This makes -ENODEV ignored again.

Fixes #17250.
This commit is contained in:
Yu Watanabe 2020-10-06 06:39:22 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 3224e38bb6
commit 1b97c5cba5

View File

@ -45,12 +45,12 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set **settle_s
r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
if (r < 0) {
bool ignore = r == -ENOENT;
bool ignore = IN_SET(r, -ENOENT, -ENODEV);
log_full_errno(ignore ? LOG_DEBUG : LOG_ERR, r,
"Failed to write '%s' to '%s'%s: %m",
action, filename, ignore ? ", ignoring" : "");
if (IN_SET(r, -EACCES, -ENODEV, -EROFS))
if (IN_SET(r, -EACCES, -EROFS))
/* Inovoked by unpriviledged user, or read only filesystem. Return earlier. */
return r;
if (ret == 0 && !ignore)