mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
udevadm trigger: do not propagate EACCES and ENODEV
Inside container, writing file returns EACCESS. Moreover, some devices return ENODEV rather than EACCES. So, let's also ignore these two error causes. Closes #13652.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
065a74a7d8
commit
67acde4869
@@ -45,9 +45,11 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_se
|
||||
|
||||
r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
|
||||
if (r < 0) {
|
||||
log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_ERR, r,
|
||||
bool ignore = IN_SET(r, -ENOENT, -EACCES, -ENODEV);
|
||||
|
||||
log_full_errno(ignore ? LOG_DEBUG : LOG_ERR, r,
|
||||
"Failed to write '%s' to '%s': %m", action, filename);
|
||||
if (ret == 0 && r != -ENOENT)
|
||||
if (ret == 0 && !ignore)
|
||||
ret = r;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user