]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: return proper value if compiled without ISSUEDIR support
authorPatrick Steinhardt <ps@pks.im>
Wed, 11 Dec 2019 13:44:22 +0000 (14:44 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 12 Dec 2019 11:22:28 +0000 (12:22 +0100)
If agetty is compiled without support for ISSUEDIR, then it implements
a stub for `issuedir_read` that simply does nothing. In fact it does
too little, as it doesn't have a proper return statement even though the
function returns an integer.

Fix the issue by always returning `1` from `issuedir_read`. This
is the same error code that the real implementation of that function
returns in case it cannot open the directory and is thus a sensible
default to pretend that the directory doesn't exist.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
term-utils/agetty.c

index a0d0876c3bf4ad320e4a06c115f917ed8b0cbef3..3c20acc9813badb00ffa08ba5c1542de3297a3af 100644 (file)
@@ -1783,6 +1783,7 @@ static int issuedir_read(struct issue *ie __attribute__((__unused__)),
                        struct options *op __attribute__((__unused__)),
                        struct termios *tp __attribute__((__unused__)))
 {
+       return 1;
 }
 #endif /* ISSUEDIR_SUPPORT */