ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
698723
From 7662d7c86d1fbb01693d4eb008fa27bf1e0030a9 Mon Sep 17 00:00:00 2001
698723
From: Lennart Poettering <lennart@poettering.net>
698723
Date: Mon, 6 Aug 2018 18:21:37 +0200
698723
Subject: [PATCH] logind: fix bad error propagation
698723
698723
(cherry picked from commit cce08496e7353e3e9903b42695aba3f9d259b90a)
698723
698723
Related: #1642460
698723
---
698723
 src/login/logind-seat.c | 2 +-
698723
 1 file changed, 1 insertion(+), 1 deletion(-)
698723
698723
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
698723
index f68fc0ceaa..9e4f009643 100644
698723
--- a/src/login/logind-seat.c
698723
+++ b/src/login/logind-seat.c
698723
@@ -175,7 +175,7 @@ static int vt_allocate(unsigned int vtnr) {
698723
         xsprintf(p, "/dev/tty%u", vtnr);
698723
         fd = open_terminal(p, O_RDWR|O_NOCTTY|O_CLOEXEC);
698723
         if (fd < 0)
698723
-                return -errno;
698723
+                return fd;
698723
 
698723
         return 0;
698723
 }