static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_set) {
sd_device *d;
- int r;
+ int r, ret = 0;
FOREACH_DEVICE_AND_SUBSYSTEM(e, d) {
_cleanup_free_ char *filename = NULL;
r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
if (r < 0) {
- log_debug_errno(r, "Failed to write '%s' to '%s', ignoring: %m", action, filename);
+ log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_ERR, r,
+ "Failed to write '%s' to '%s': %m", action, filename);
+ if (ret == 0 && r != -ENOENT)
+ ret = r;
continue;
}
}
}
- return 0;
+ return ret;
}
static int device_monitor_handler(sd_device_monitor *m, sd_device *dev, void *userdata) {