1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00

tty-ask-password-agent: return negative errno

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>
This commit is contained in:
Florian Albrechtskirchinger 2014-04-03 21:17:20 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent b3ae710c25
commit ee0e4cca5a
Notes: Zbigniew Jędrzejewski-Szmek 2014-04-07 12:41:12 -04:00
Backport: bugfix

View File

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