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)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Jan 2019 05:22:28 +0000 (14:22 +0900)
src/login/logind-seat.c

index c758ffd..a6d88f8 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;
         }