logind: do not pass negative number to strerror
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 9 Jan 2019 13:08:29 +0000 (14:08 +0100)
committerMichael Biebl <biebl@debian.org>
Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)
(cherry picked from commit 65641b3cdc12923320879bac6f071eb45a70e79c)
(cherry picked from commit 8f8f3191d33ca8583fe62a9e6268e2a914a7b2c0)

Gbp-Pq: Name logind-do-not-pass-negative-number-to-strerror.patch

src/login/logind-seat.c

index c758ffd5fad0a0130de29cf880b923274af3820b..a6d88f8e7b83c4d98aba4e7c871e4615ecf680bf 100644 (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;
         }