summaryrefslogtreecommitdiffstats
path: root/comms
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2011-11-20 14:36:57 +0000
committerolgeni <olgeni@FreeBSD.org>2011-11-20 14:36:57 +0000
commitd1b051f97011977bf2d4ecba9a7b70988728b1d1 (patch)
tree66ecf58a117de211182ef00149f2ee67dfe26d87 /comms
parent6c4d9a454b88ef8df0d0841efb0d64d47ea03748 (diff)
downloadFreeBSD-ports-d1b051f97011977bf2d4ecba9a7b70988728b1d1.zip
FreeBSD-ports-d1b051f97011977bf2d4ecba9a7b70988728b1d1.tar.gz
Unbreak on 9.x with utmpx.
mgetty already has utmpx support for SVR4; we can borrow it with a few changes to make utmpx work. Feature safe: yes
Diffstat (limited to 'comms')
-rw-r--r--comms/mgetty+sendfax/Makefile4
-rw-r--r--comms/mgetty+sendfax/files/patch-mg__utmp.h46
-rw-r--r--comms/mgetty+sendfax/files/patch-utmp.c20
3 files changed, 66 insertions, 4 deletions
diff --git a/comms/mgetty+sendfax/Makefile b/comms/mgetty+sendfax/Makefile
index e381a25..ec1b579 100644
--- a/comms/mgetty+sendfax/Makefile
+++ b/comms/mgetty+sendfax/Makefile
@@ -70,10 +70,6 @@ MAKE_JOBS_UNSAFE= yes
.include <bsd.port.pre.mk>
-.if ${OSVERSION} > 900007
-BROKEN= fails to build with new utmpx
-.endif
-
CFLAGS+= -DAUTO_PPP
.if defined(WITH_FIDO) && ${WITH_FIDO:L} != no
CFLAGS+= -DFIDO
diff --git a/comms/mgetty+sendfax/files/patch-mg__utmp.h b/comms/mgetty+sendfax/files/patch-mg__utmp.h
new file mode 100644
index 0000000..fdc57b4
--- /dev/null
+++ b/comms/mgetty+sendfax/files/patch-mg__utmp.h
@@ -0,0 +1,46 @@
+
+$FreeBSD$
+
+--- mg_utmp.h.orig
++++ mg_utmp.h
+@@ -1,4 +1,4 @@
+-#ident "$Id: mg_utmp.h,v 4.1 1997/01/12 14:53:42 gert Exp $ Copyright (c) Gert Doering"
++static char sccs_mg_utmp[] = "$Id: mg_utmp.h,v 4.1 1997/01/12 14:53:42 gert Exp $ Copyright (c) Gert Doering";
+
+ /* definitions for utmp reading / writing routines,
+ * highly SysV / BSD dependent
+@@ -31,6 +31,25 @@
+
+ #else /* SunOS or generic BSD */
+
++#if defined(__FreeBSD__) && (__FreeBSD_version >= 900007)
++
++# include <utmpx.h>
++# define utmp utmpx
++# define getutent getutxent
++# define getutid getutxid
++# define getutline getutxline
++# define pututline pututxline
++# define setutent setutxent
++# define endutent endutxent
++# define ut_time ut_tv
++# define ut_name ut_user
++
++#define UT_INIT INIT_PROCESS
++#define UT_LOGIN LOGIN_PROCESS
++#define UT_USER USER_PROCESS
++
++#else
++
+ #include <sys/types.h>
+ #include <utmp.h>
+
+@@ -41,6 +60,8 @@
+ #define UT_LOGIN 1
+ #define UT_USER 2
+
++#endif /* __FreeBSD_version */
++
+ #endif /* SysV vs. BSD */
+
+ /* prototypes */
diff --git a/comms/mgetty+sendfax/files/patch-utmp.c b/comms/mgetty+sendfax/files/patch-utmp.c
new file mode 100644
index 0000000..54d09cc
--- /dev/null
+++ b/comms/mgetty+sendfax/files/patch-utmp.c
@@ -0,0 +1,20 @@
+
+$FreeBSD$
+
+--- utmp.c.orig
++++ utmp.c
+@@ -1,4 +1,4 @@
+-#ident "$Id: utmp.c,v 4.4 2001/12/17 22:43:24 gert Exp $ Copyright (c) Gert Doering"
++static char sccsid[] = "$Id: utmp.c,v 4.4 2001/12/17 22:43:24 gert Exp $ Copyright (c) Gert Doering";
+
+ /* some parts of the code (writing of the utmp entry)
+ * is based on the "getty kit 2.0" by Paul Sutcliffe, Jr.,
+@@ -58,7 +58,7 @@
+ * [NB: If we wanted to set UT_INIT, it would have to be an entry with
+ * empty ut_name and ut_host]
+ */
+-#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if (defined(__FreeBSD__) && (__FreeBSD_version < 900007)) || defined(__NetBSD__)
+ struct utmp utmp;
+ extern void login _PROTO(( struct utmp * utmp ));
+
OpenPOWER on IntegriCloud