1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

Make conserver build under HEAD (900008).

Split patch-sgtty into the two respecitve files it patches.
This commit is contained in:
Cy Schubert 2010-01-28 06:07:17 +00:00
parent 935c866afb
commit 06b51ff960
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=248745
3 changed files with 141 additions and 63 deletions

View File

@ -0,0 +1,68 @@
--- etc/autologin/autologin.c.orig 2000-08-02 11:39:42.000000000 -0700
+++ etc/autologin/autologin.c 2010-01-27 21:58:21.000000000 -0800
@@ -23,7 +23,15 @@
#include <pwd.h>
#include <grp.h>
#include <errno.h>
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
+#include <utmpx.h>
+#define utmp utmpx
+#define setutent setutxent
+#define getutent getutxent
+#define endutent endutxent
+#else
#include <utmp.h>
+#endif
#include "machine.h"
@@ -189,7 +197,12 @@
(void)strncpy(utmp.ut_host, "(autologin)", sizeof(utmp.ut_host));
#endif
#endif
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
+ utmp.ut_tv.tv_sec = time((time_t *) 0);
+ utmp.ut_tv.tv_usec = 0;
+#else
utmp.ut_time = time((time_t *) 0);
+#endif
if (0 == iFound) {
fprintf(stderr, "%s: %s: no ttyslot\n", progname, pctty);
@@ -443,11 +456,36 @@
/* NOTREACHED */
}
#endif
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
+ /* XXX: FreeBSD does not support IUCLC, translate uppercase characters
+ to lowercase */
+ n_tio.c_iflag &= ~(IGNCR);
+#else
n_tio.c_iflag &= ~(IGNCR|IUCLC);
+#endif
n_tio.c_iflag |= ICRNL|IXON|IXANY;
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
+ /*
+ XXX: FreeBSD does not support OLCUC, translater lowercase
+ to uppercase
+ XXX: FreeBSD does not support OFILL, use fill (padding) characters
+ instead of timing for delays
+ XXX: FreeBSD does not support NLDLY, newline delay (nlN)
+ XXX: FreeBSD does not support CRDLY, carrier return delay (crN)
+ XXX: FreeBSD does not support BSDLY, backspace dealy (bsN)
+ */
+ n_tio.c_oflag &= ~(ONOCR|ONLRET|TABDLY);
+#else
n_tio.c_oflag &= ~(OLCUC|ONOCR|ONLRET|OFILL|NLDLY|CRDLY|TABDLY|BSDLY);
+#endif
n_tio.c_oflag |= OPOST|ONLCR|TAB3;
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
+ /* XXX: FreeBSD does not support XCASE, with icanon, escape with '\'
+ for uppercase characters */
+ n_tio.c_lflag &= ~(NOFLSH|ECHOK|ECHONL);
+#else
n_tio.c_lflag &= ~(XCASE|NOFLSH|ECHOK|ECHONL);
+#endif
n_tio.c_lflag |= ISIG|ICANON|ECHO;
n_tio.c_cc[VEOF] = '\004'; /* ^D */
n_tio.c_cc[VEOL] = '\000'; /* EOL */

View File

@ -0,0 +1,73 @@
--- etc/autologin/machine.h.orig 2000-08-02 11:39:42.000000000 -0700
+++ etc/autologin/machine.h 2010-01-27 20:58:40.000000000 -0800
@@ -1,7 +1,6 @@
/* $Id: machine.h,v 2.8 1997/11/10 17:10:34 ksb Exp $
* leverage in liew of L7
*/
-
#if !defined(HPUX) && (defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(HPUX10))
#define HPUX 1
#endif
@@ -17,11 +16,11 @@
#endif
#if !defined(USE_OLD_UTENT)
-#define USE_OLD_UTENT (defined(SUN4)||defined(FREEBSD)||defined(NETBSD)||defined(S81))
+#define USE_OLD_UTENT (defined(SUN4)||(defined(FREEBSD) && defined(__FreeBSD_version) && __FreeBSD_version < 900008)||defined(NETBSD)||defined(S81))
#endif
#if !defined(USE_UTENT)
-#define USE_UTENT (defined(SUN5)||defined(EPIX)||defined(PARAGON)||defined(IBMR2)||defined(HPUX9)||defined(HPUX10)||defined(LINUX))
+#define USE_UTENT (defined(SUN5)||defined(EPIX)||defined(PARAGON)||defined(IBMR2)||defined(HPUX9)||defined(HPUX10)||defined(LINUX))||defined(__FreeBSD_version) && __FreeBSD_version > 900007
#endif
#if !defined(NEED_PUTENV)
@@ -38,7 +37,7 @@
#define USE_TERMIO (defined(ETA10)||defined(V386))
#endif
#if !defined(USE_TERMIOS)
-#define USE_TERMIOS (defined(HPUX)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX))
+#define USE_TERMIOS (defined(HPUX)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX))||(defined(__FreeBSD_version) && __FreeBSD_version > 900007)
#endif
#if !defined(USE_TCBREAK)
#define USE_TCBREAK (defined(SUN4)||defined(PTX))
@@ -66,7 +65,7 @@
#endif
#if !defined(USE_TC)
-#define USE_TC (defined(EPIX)||defined(IBMR2)||defined(V386)||defined(S81)||defined(PARAGON))
+#define USE_TC (defined(EPIX)||defined(IBMR2)||defined(V386)||defined(S81)||defined(PARAGON)||(defined(__FreeBSD_version) && __FreeBSD_version > 900007))
#endif
#if !defined(HAVE_GETUSERATTR)
@@ -74,7 +73,7 @@
#endif
#if !defined(USE_IOCTL)
-#define USE_IOCTL (defined(V386)||defined(S81)||defined(NETBSD)||defined(FREEBSD))
+#define USE_IOCTL (defined(V386)||defined(S81)||defined(NETBSD)||(defined(FREEBSD)&&(defined(__FreeBSD_version) && __FreeBSD_version < 900008)))
#endif
@@ -127,8 +126,12 @@
#if FREEBSD
#include <sys/uio.h>
#include <sys/proc.h>
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
+#include <termios.h>
+#else
#include <sys/ioctl_compat.h>
#define setsid() getpid()
+#endif
#else
#endif /* NETBSD */
@@ -148,7 +151,7 @@
#if HPUX
#define HAVE_GETSID (defined(HPUX10)||defined(LINUX))
#else
-#if PARAGON || SUNOS || SUN4 || SUN5 || NETBSD || S81 || V386 || IBMR2 || EPIX
+#if PARAGON || SUNOS || SUN4 || SUN5 || NETBSD || S81 || V386 || IBMR2 || EPIX || defined(__FreeBSD_version) && __FreeBSD_version > 900007
#define HAVE_GETSID 1
#else
#define HAVE_GETSID 0

View File

@ -1,63 +0,0 @@
--- etc/autologin/autologin.c
+++ etc/autologin/autologin.c
@@ -41,7 +41,6 @@
#if USE_TERMIOS
#include <termios.h>
-#include <unistd.h>
#else
#if USE_TERMIO
@@ -443,11 +442,11 @@
/* NOTREACHED */
}
#endif
- n_tio.c_iflag &= ~(IGNCR|IUCLC);
+ n_tio.c_iflag &= ~(IGNCR);
n_tio.c_iflag |= ICRNL|IXON|IXANY;
- n_tio.c_oflag &= ~(OLCUC|ONOCR|ONLRET|OFILL|NLDLY|CRDLY|TABDLY|BSDLY);
- n_tio.c_oflag |= OPOST|ONLCR|TAB3;
- n_tio.c_lflag &= ~(XCASE|NOFLSH|ECHOK|ECHONL);
+ n_tio.c_oflag &= ~(ONOCR|ONLRET);
+ n_tio.c_oflag |= OPOST|ONLCR|OXTABS;
+ n_tio.c_lflag &= ~(NOFLSH|ECHOK|ECHONL);
n_tio.c_lflag |= ISIG|ICANON|ECHO;
n_tio.c_cc[VEOF] = '\004'; /* ^D */
n_tio.c_cc[VEOL] = '\000'; /* EOL */
--- etc/autologin/machine.h
+++ etc/autologin/machine.h
@@ -38,7 +38,7 @@
#define USE_TERMIO (defined(ETA10)||defined(V386))
#endif
#if !defined(USE_TERMIOS)
-#define USE_TERMIOS (defined(HPUX)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX))
+#define USE_TERMIOS (defined(HPUX)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX)||defined(FREEBSD))
#endif
#if !defined(USE_TCBREAK)
#define USE_TCBREAK (defined(SUN4)||defined(PTX))
@@ -66,7 +66,7 @@
#endif
#if !defined(USE_TC)
-#define USE_TC (defined(EPIX)||defined(IBMR2)||defined(V386)||defined(S81)||defined(PARAGON))
+#define USE_TC (defined(EPIX)||defined(IBMR2)||defined(V386)||defined(S81)||defined(PARAGON)||defined(FREEBSD))
#endif
#if !defined(HAVE_GETUSERATTR)
@@ -74,7 +74,7 @@
#endif
#if !defined(USE_IOCTL)
-#define USE_IOCTL (defined(V386)||defined(S81)||defined(NETBSD)||defined(FREEBSD))
+#define USE_IOCTL (defined(V386)||defined(S81)||defined(NETBSD))
#endif
@@ -127,7 +127,6 @@
#if FREEBSD
#include <sys/uio.h>
#include <sys/proc.h>
-#include <sys/ioctl_compat.h>
#define setsid() getpid()
#else