From 8debc401f85924fd4456a80182ec7ede713b59dd Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sun, 22 Nov 2009 22:22:09 +0000 Subject: [PATCH] Make sure bootlogd findpty() returns an error value when it fails to find a usable pty. Patch from Rob Leslie via Debian. --- doc/Changelog | 2 ++ src/bootlogd.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index fc507c3..9a9c63c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -22,6 +22,8 @@ sysvinit (2.88dsf) UNRELEASED; urgency=low * Rewrite findtty() in bootlogd to recursively search /dev/ for the correct device, to handle terminal devices for example in /dev/pty/. Patch from Debian. + * Make sure bootlogd findpty() returns an error value when it fails to + find a usable pty. Patch from Rob Leslie via Debian. -- Petter Reinholdtsen Sun, 12 Jul 2009 19:58:10 +0200 diff --git a/src/bootlogd.c b/src/bootlogd.c index 924f502..e2eb4d8 100644 --- a/src/bootlogd.c +++ b/src/bootlogd.c @@ -198,7 +198,7 @@ int findpty(int *master, int *slave, char *name) } if (found) break; } - if (found < 0) return -1; + if (!found) return -1; if (name) strcpy(name, tty);