From: Aurelien Jarno Date: Fri, 29 May 2009 09:28:45 +0000 (-0600) Subject: remaining kFreeBSD hackery for building. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0efa51f2664377305f8004a8828a881643bf47e;p=util-linux remaining kFreeBSD hackery for building. Addresses-Debian-Bug: #527384 Signed-off-by: LaMont Jones --- diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am index 5ed581b8..0386cee4 100644 --- a/login-utils/Makefile.am +++ b/login-utils/Makefile.am @@ -11,6 +11,7 @@ EXTRA_DIST = README.getty README.modems-with-agetty README.poeigl if BUILD_AGETTY sbin_PROGRAMS += agetty dist_man_MANS += agetty.8 +agetty_LDADD = -lutil endif if BUILD_INIT diff --git a/login-utils/agetty.c b/login-utils/agetty.c index 90a64b33..817ec05f 100644 --- a/login-utils/agetty.c +++ b/login-utils/agetty.c @@ -37,7 +37,11 @@ #include "nls.h" #include "pathnames.h" -#ifdef __linux__ +#if defined(__FreeBSD_kernel__) +#include +#endif + +#if defined(__linux__) || defined(__FreeBSD_kernel__) #include #define USE_SYSLOG #endif @@ -281,7 +285,7 @@ main(argc, argv) parse_args(argc, argv, &options); -#ifdef __linux__ +#if defined (__linux__) || defined(__FreeBSD_kernel__) setsid(); #endif @@ -670,6 +674,13 @@ open_tty(tty, tp, local) if (tcgetattr(0, tp) < 0) error("%s: tcgetattr: %m", tty); + /* + * login_tty: steal tty from other process group. + */ +#if defined(__FreeBSD_kernel__) + login_tty (0); +#endif + /* * It seems to be a terminal. Set proper protections and ownership. Mode * 0622 is suitable for SYSV <4 because /bin/login does not change diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c index 55d5c80f..1567f9a6 100644 --- a/sys-utils/ipcs.c +++ b/sys-utils/ipcs.c @@ -499,8 +499,10 @@ void do_msg (char format) case STATUS: printf (_("------ Messages: Status --------\n")); +#ifndef __FreeBSD_kernel__ printf (_("allocated queues = %d\n"), msginfo.msgpool); printf (_("used headers = %d\n"), msginfo.msgmap); +#endif printf (_("used space = %d bytes\n"), msginfo.msgtql); return;