logind: do not pass negative number to strerror

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-01-10 14:22:28 +09:00
committed by Yu Watanabe
parent a685c049c0
commit 65641b3cdc
+1 -1
View File
@@ -376,7 +376,7 @@ int seat_read_active_vt(Seat *s) {
k = read(s->manager->console_active_fd, t, sizeof(t)-1);
if (k <= 0) {
log_error("Failed to read current console: %s", k < 0 ? strerror(-errno) : "EOF");
log_error("Failed to read current console: %s", k < 0 ? strerror(errno) : "EOF");
return k < 0 ? -errno : -EIO;
}