summaryrefslogtreecommitdiff
path: root/x11-toolkits/xview
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2011-09-25 05:48:13 +0000
committerCy Schubert <cy@FreeBSD.org>2011-09-25 05:48:13 +0000
commited5b7be17fdfc9573dbee2a08a36d2d41b4a029b (patch)
tree4ca56ec3dfc64cb25ef6c2196a699fd63353b584 /x11-toolkits/xview
parentWhen not -D BATCH mark IS_INTERACTIVE, make imake dependency unconditional (diff)
Fix build under 9.0 (with new utmpx).
Notes
Notes: svn path=/head/; revision=282352
Diffstat (limited to 'x11-toolkits/xview')
-rw-r--r--x11-toolkits/xview/Makefile4
-rw-r--r--x11-toolkits/xview/files/patch-lib+libxview+ttysw+tty_init.c101
2 files changed, 94 insertions, 11 deletions
diff --git a/x11-toolkits/xview/Makefile b/x11-toolkits/xview/Makefile
index b70558a98e82..cd79ab57a2a0 100644
--- a/x11-toolkits/xview/Makefile
+++ b/x11-toolkits/xview/Makefile
@@ -44,10 +44,6 @@ X11BASE2FIX= clients/olwmslave/help_file.c lib/libxview/help/help_file.c \
CFLAGS+= -DCOMPAT_43TTY
.endif
-.if ${OSVERSION} > 900007
-BROKEN= fails to build with new utmpx
-.endif
-
pre-configure:
@${REINPLACE_CMD} -e 's+/usr/local+${PREFIX}+;' \
${WRKSRC}/config/XView.cf
diff --git a/x11-toolkits/xview/files/patch-lib+libxview+ttysw+tty_init.c b/x11-toolkits/xview/files/patch-lib+libxview+ttysw+tty_init.c
index 4a3f98e32780..bf40a6bd435a 100644
--- a/x11-toolkits/xview/files/patch-lib+libxview+ttysw+tty_init.c
+++ b/x11-toolkits/xview/files/patch-lib+libxview+ttysw+tty_init.c
@@ -1,5 +1,5 @@
---- lib/libxview/ttysw/tty_init.c.orig Tue Jun 29 00:17:19 1993
-+++ lib/libxview/ttysw/tty_init.c Fri Oct 17 09:40:42 2003
+--- lib/libxview/ttysw/tty_init.c.orig 1993-06-28 22:17:19.000000000 -0700
++++ lib/libxview/ttysw/tty_init.c 2011-09-24 22:14:48.726921496 -0700
@@ -14,6 +14,7 @@
* Ttysw initialization, destruction and error procedures
*/
@@ -8,7 +8,25 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
-@@ -82,7 +83,11 @@
+@@ -23,10 +24,17 @@
+
+ #include <xview_private/portable.h> /* for XV* defines and termios */
+
++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
++#define SVR4
++#define XV_USE_SVR4_PTYS
++#endif
++
+ #ifdef XV_USE_SVR4_PTYS
++#if !(defined(__FreeBSD_version) && __FreeBSD_version > 900007)
+ #include <sys/stream.h>
+ #include <sys/stropts.h>
+ #include <sys/bufmod.h>
++#endif
+ #endif /* XV_USE_SVR4_PTYS */
+
+ #ifndef SVR4
+@@ -82,7 +90,11 @@
extern char *strncpy();
extern char *strcpy();
@@ -20,7 +38,7 @@
char *textsw_checkpoint_undo();
/* static */ void ttysw_parseargs();
-@@ -106,6 +111,7 @@
+@@ -106,6 +118,7 @@
extern int ttysel_use_seln_service;
@@ -28,7 +46,7 @@
struct ttysw_createoptions {
int becomeconsole; /* be the console */
-@@ -518,6 +524,9 @@
+@@ -518,6 +531,9 @@
(void) dup2(ttysw->ttysw_tty, 2);
(void) close(ttysw->ttysw_tty);
@@ -38,7 +56,76 @@
if (*argv == (char *) NULL || strcmp("-c", *argv) == 0) {
/* Process arg list */
int argc;
-@@ -955,7 +964,11 @@
+@@ -544,15 +560,25 @@
+ * ttcompat seems to leave things in a funny state and assumes
+ * (seemingly) that login will fix things up. Do it here.
+ */
++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
++ if (tcgetattr (0, &tp) == -1)
++ perror("tcgetattr");
++#else
+ if (ioctl (0, TCGETS, &tp) == -1)
+ perror("ioctl TCGETS");
++#endif
+ else {
+ tp.c_lflag |= ECHO;
+ tp.c_oflag |= ONLCR;
+ tp.c_iflag |= ICRNL;
+ }
++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007
++ if (tcsetattr (0, TCSANOW, &tp) == -1)
++ perror("tcsetattr");
++#else
+ if (ioctl (0, TCSETS, &tp) == -1)
+ perror("ioctl TCSETS");
++#endif
+ #endif /* BSD_TTY_COMPAT */
+ #endif /* SVR4 */
+
+@@ -739,7 +765,9 @@
+
+ #ifdef SB_NO_DROPS /* defined as result of including new bufmod.h */
+
++#if !defined(__FreeBSD_version)
+ if(ioctl(pty, I_PUSH, "bufmod") == -1) { /* some buffering ... */
++#endif
+
+ /* we can't push bufmod... this means we're probably
+ running on a generic SVR4 system - we can ignore this
+@@ -864,13 +892,16 @@
+ #endif SB_NO_DROPS
+
+
++#ifndef __FreeBSD_version
+ if (ioctl(pty, I_PUSH, "pckt") == -1) { /* must use getmsg for read */
+ perror("push pckt");
+ return XV_ERROR;
+ }
++#endif
+
+ if ((tty = open(ptsname(pty),O_RDWR))<0)
+ return XV_ERROR;
++#ifndef __FreeBSD_version
+ if (ioctl(tty, I_PUSH, "ptem") == -1) {
+ perror("push ptem");
+ return XV_ERROR;
+@@ -879,12 +910,15 @@
+ perror("push ldterm");
+ return XV_ERROR;
+ }
++#endif
+ #ifdef BSD_TTY_COMPAT
++#ifndef __FreeBSD_version
+ if (ioctl(tty, I_PUSH, "ttcompat") == -1) { /* for csh */
+ perror("push ttcompat");
+ return XV_ERROR;
+ }
+ #endif
++#endif
+
+ #endif /* SVR4 */
+
+@@ -955,7 +989,11 @@
struct utmpx utmp;
#endif
struct passwd *passwdent;
@@ -50,7 +137,7 @@
int f;
char *ttyn;
extern char *ttyname();
-@@ -1007,13 +1020,22 @@
+@@ -1007,13 +1045,22 @@
XV_MSG("Add tty[qrs][0-f] to /etc/ttys file.\n"));
return (0);
}