logind: fix bad error propagation
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Aug 2018 16:21:37 +0000 (18:21 +0200)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Fri, 20 Aug 2021 11:06:37 +0000 (13:06 +0200)
(cherry picked from commit cce08496e7353e3e9903b42695aba3f9d259b90a)

Related: #1642460

src/login/logind-seat.c

index f68fc0ceaa31d27120184c40472aa5371d492edb..9e4f009643a0585c087a46008260d412af3abce4 100644 (file)
@@ -175,7 +175,7 @@ static int vt_allocate(unsigned int vtnr) {
         xsprintf(p, "/dev/tty%u", vtnr);
         fd = open_terminal(p, O_RDWR|O_NOCTTY|O_CLOEXEC);
         if (fd < 0)
-                return -errno;
+                return fd;
 
         return 0;
 }