$NetBSD: patch-ab,v 1.3 2012/05/04 16:38:44 joerg Exp $

--- 9term/9term.c.orig	1994-06-03 08:35:39.000000000 +0000
+++ 9term/9term.c
@@ -10,10 +10,22 @@
 #include <frame.h>
 #include <text.h>
 
+#include <sys/param.h>
+
+#if (defined(BSD) && BSD >= 199306)
+#include <sys/termios.h>
+#else
 #include <sys/termio.h>
+#endif
 #include <signal.h>
 #include <sys/stat.h>
 
+#define Cursor X11Cursor
+#define Font X11Font
+#include <X11/Intrinsic.h>
+#undef Cursor
+#undef Font
+
 #include "9term.h"
 
 int		flushing;
@@ -113,7 +125,7 @@ usage(char *s)
  *	Parse args, initialize display, spin off command interpreter
  *	and start handling keyboard, mouse, and command output events.
  */
-void
+int
 main(int argc,char **argv)
 {
 	int i, j;
@@ -153,9 +165,9 @@ main(int argc,char **argv)
 		}
 	}
 
-	setenv("TERM", "9term", 1);
+	O_setenv("TERM", "9term", 1);
 	/* Cope with BSD-oid systems. - cks */
-	setenv("TERMCAP", "9term: :am:bl=^G:do=^J:nl=^J:", 1);
+	O_setenv("TERMCAP", "9term: :am:bl=^G:do=^J:nl=^J:", 1);
 	signal(SIGINT, SIG_IGN);
 
 	init_display(&argc, argv, cmd, resource);
@@ -718,7 +730,7 @@ interrupt(Text *t, Rune r)
 	texthighlight(t, t->length, t->length, F&~D);
 #ifdef REMOTE
 	flushstream();
-	killpg(r == quitchar ? SIGQUIT : SIGINT);
+	O_killpg(r == quitchar ? SIGQUIT : SIGINT);
 #else
 	sendrunes(&r, 1);
 #endif
@@ -803,8 +815,8 @@ worderase(Text *t)
 /*
  *	export a name-value pair to environment
  */
-int
-setenv(char *name, char *value, int overwrite)
+void
+O_setenv(char *name, char *value, int overwrite)
 {
 	char *p;
 
