Index: Imakefile
===================================================================
RCS file: /cvs/fd/xorg/xc/programs/xconsole/Imakefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Imakefile
--- Imakefile	14 Nov 2003 16:48:58 -0000	1.1.1.1
+++ Imakefile	14 Jul 2005 11:22:36 -0000
@@ -1,9 +1,14 @@
 XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:54:13 cpqbld Exp $
+
+#if defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) \
+	|| defined(FreeBSDArchitecture)
+         PTYLIB = -lutil
+#endif
           SRCS = xconsole.c
           OBJS = xconsole.o
        PROGRAMS = xconsole
         DEPLIBS = XawClientDepLibs
-LOCAL_LIBRARIES = XawClientLibs
+LOCAL_LIBRARIES = XawClientLibs $(PTYLIB)
 
 ComplexProgramTarget(xconsole)
 
Index: xconsole.c
===================================================================
RCS file: /cvs/fd/xorg/xc/programs/xconsole/xconsole.c,v
retrieving revision 1.4
diff -u -r1.4 xconsole.c
--- xconsole.c	7 Jul 2005 23:08:22 -0000	1.4
+++ xconsole.c	14 Jul 2005 11:22:36 -0000
@@ -61,6 +61,9 @@
 #include <X11/Shell.h>
 #include <ctype.h>
 #include <stdlib.h>
+#ifdef CSRG_BASED
+#include <util.h>
+#endif
 
 /* Fix ISC brain damage.  When using gcc fdopen isn't declared in <stdio.h>. */
 #if defined(ISC) && __STDC__ && !defined(ISC30)
@@ -791,7 +794,12 @@
 static int
 get_pty(int *pty, int *tty, char *ttydev, char *ptydev)
 {
-#if defined (SVR4) || defined (USE_PTS)
+#ifdef CSRG_BASED
+	if (openpty(pty, tty, NULL, NULL, NULL) < 0) {
+		return 1;
+	}
+	return 0;
+#elif defined (SVR4) || defined (USE_PTS)
 	if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0)
 	    return 1;
 	grantpt(*pty);
