summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorChristoph Egger2014-08-24 18:04:43 +0200
committerKarel Zak2014-09-17 10:14:50 +0200
commitc32270d41f3cf8f3d03f2418180e72c99e13a389 (patch)
treea523e54edacc6884165c4ad298e4c65467865f2f /term-utils/agetty.c
parentipcs: remaining kFreeBSD hackery for building. (diff)
downloadkernel-qcow2-util-linux-c32270d41f3cf8f3d03f2418180e72c99e13a389.tar.gz
kernel-qcow2-util-linux-c32270d41f3cf8f3d03f2418180e72c99e13a389.tar.xz
kernel-qcow2-util-linux-c32270d41f3cf8f3d03f2418180e72c99e13a389.zip
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
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c16
1 files changed, 16 insertions, 0 deletions
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 <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -44,6 +45,12 @@
#include "widechar.h"
#include "ttyutils.h"
+#if defined(__FreeBSD_kernel__)
+#include <pty.h>
+#include <sys/param.h>
+#endif
+
+
#ifdef __linux__
# include <sys/kd.h>
# include <sys/param.h>
@@ -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 <syslog.h>
@@ -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