From c32270d41f3cf8f3d03f2418180e72c99e13a389 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Sun, 24 Aug 2014 18:04:43 +0200 Subject: agetty: fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2) Handle vc flags missing on FreeBSD Fix tty creation on kFreeBSD taking patch from 2.19 Addresses-Debian-Bug: #650185 --- term-utils/agetty.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'term-utils/agetty.c') diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 3c30a5fef..a7044f0ff 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -10,6 +10,7 @@ * * This program is freely distributable. */ + #include #include #include @@ -44,6 +45,12 @@ #include "widechar.h" #include "ttyutils.h" +#if defined(__FreeBSD_kernel__) +#include +#include +#endif + + #ifdef __linux__ # include # include @@ -76,6 +83,10 @@ # endif #endif +#ifdef __FreeBSD_kernel__ +#define USE_SYSLOG +#endif + /* If USE_SYSLOG is undefined all diagnostics go to /dev/console. */ #ifdef USE_SYSLOG # include @@ -1110,6 +1121,11 @@ static void open_tty(char *tty, struct termios *tp, struct options *op) op->term = DEFAULT_TTYS1; } #endif + +#if defined(__FreeBSD_kernel__) + login_tty (0); +#endif + /* * Detect if this is a virtual console or serial/modem line. * In case of a virtual console the ioctl KDGKBMODE succeeds -- cgit v1.2.3-55-g7522