84b277
From 2ae90f52f6ce48f24dcb585b8c0b02dc461cfc4e Mon Sep 17 00:00:00 2001
84b277
From: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
84b277
Date: Thu, 3 Apr 2014 21:17:20 +0200
84b277
Subject: [PATCH] tty-ask-password-agent: return negative errno
84b277
84b277
Return negative errno in wall_tty_block(). get_ctty_devnr() already
84b277
returns a negative errno in case of failure, no need to negate it again.
84b277
84b277
Reported-by: Simon <hwold@odai.homelinux.net>
84b277
84b277
(cherry-picked from ee0e4cca5ac37a094dfe1074907dae70c7b7701c)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/tty-ask-password-agent/tty-ask-password-agent.c | 2 +-
84b277
 1 file changed, 1 insertion(+), 1 deletion(-)
84b277
84b277
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
84b277
index f463662..256c21d 100644
84b277
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
84b277
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
84b277
@@ -438,7 +438,7 @@ static int wall_tty_block(void) {
84b277
 
84b277
         r = get_ctty_devnr(0, &devnr);
84b277
         if (r < 0)
84b277
-                return -r;
84b277
+                return r;
84b277
 
84b277
         if (asprintf(&p, "/run/systemd/ask-password-block/%u:%u", major(devnr), minor(devnr)) < 0)
84b277
                 return -ENOMEM;