r = verify_vc_allocation(i);
if (r < 0) {
- if (!err)
- err = -r;
+ log_debug_errno(r, "VC %u existance check failed, skipping: %m", i);
+ RET_GATHER(err, r);
continue;
}
fd = open_terminal(path, O_RDWR|O_CLOEXEC|O_NOCTTY);
if (fd < 0) {
- if (!err)
- err = -fd;
+ log_debug_errno(fd, "Failed to open terminal %s, ignoring: %m", path);
+ RET_GATHER(err, r);
continue;
}
r = verify_vc_kbmode(fd);
if (r < 0) {
- if (!err)
- err = -r;
+ log_debug_errno(r, "Failed to check VC %s keyboard mode: %m", path);
+ RET_GATHER(err, r);
continue;
}