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