chiark / gitweb /
tty-ask-password-agent: return negative errno
authorFlorian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Thu, 3 Apr 2014 19:17:20 +0000 (21:17 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Apr 2014 04:55:19 +0000 (00:55 -0400)
Return negative errno in wall_tty_block(). get_ctty_devnr() already
returns a negative errno in case of failure, no need to negate it again.

Reported-by: Simon <hwold@odai.homelinux.net>
src/tty-ask-password-agent/tty-ask-password-agent.c

index 1d067af..3203474 100644 (file)
@@ -432,7 +432,7 @@ static int wall_tty_block(void) {
 
         r = get_ctty_devnr(0, &devnr);
         if (r < 0)
-                return -r;
+                return r;
 
         if (asprintf(&p, "/run/systemd/ask-password-block/%u:%u", major(devnr), minor(devnr)) < 0)
                 return -ENOMEM;