From 8bbf5a7a1b6940eeef0581bb16445c59974bd054 Mon Sep 17 00:00:00 2001 From: Pascal Stumpf Date: Fri, 10 Aug 2012 14:29:28 +0200 Subject: [PATCH] Allow dtterm to at least allocate a pty on OpenBSD. Display is still mangled, however, and it frequently crashes (64bit issue). --- cde/lib/DtTerm/Imakefile | 5 +++++ cde/lib/DtTerm/TermPrim/TermPrimGetPty-bsd.c | 5 ++++- cde/programs/dtterm/util/logger.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cde/lib/DtTerm/Imakefile b/cde/lib/DtTerm/Imakefile index 8d502d7f..f4d86a66 100644 --- a/cde/lib/DtTerm/Imakefile +++ b/cde/lib/DtTerm/Imakefile @@ -25,6 +25,11 @@ INCLUDES = -I. -I./TermPrim -I./Term -I./TermView REQUIREDLIBS = SharedDtTermReqs #endif +/* for openpty */ +#if defined(OpenBSDArchitecture) +REQUIREDLIBS += -lutil +#endif + TERMPRIM_OBJS = \ TermPrim/TermPrim.o \ TermPrim/TermPrimAction.o \ diff --git a/cde/lib/DtTerm/TermPrim/TermPrimGetPty-bsd.c b/cde/lib/DtTerm/TermPrim/TermPrimGetPty-bsd.c index b8bfd3a0..8507cdf3 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimGetPty-bsd.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimGetPty-bsd.c @@ -37,6 +37,9 @@ static char rcs_id[] = "$XConsortium: TermPrimGetPty-bsd.c /main/4 1996/11/21 19 #include "TermHeader.h" #include #include +#if defined(OPENBSD_ARCHITECTURE) +#include +#endif #include #include #include @@ -166,7 +169,7 @@ static struct _pty_dirs { {PTY_null, PTY_null, PTY_null, PTY_null, PTY_null, False}, }; -#if defined(ALPHA_ARCHITECTURE) || defined(OpenBSDArchitecture) +#if defined(ALPHA_ARCHITECTURE) || defined(OPENBSD_ARCHITECTURE) /* Use openpty() to open Master/Slave pseudo-terminal pair */ /* Current version of openpty() uses non-STREAM device. BSD name space */ #define TTYNAMELEN 25 diff --git a/cde/programs/dtterm/util/logger.c b/cde/programs/dtterm/util/logger.c index 0f51669d..dc5c8cca 100644 --- a/cde/programs/dtterm/util/logger.c +++ b/cde/programs/dtterm/util/logger.c @@ -72,7 +72,7 @@ main(int argc, char **argv) } /* init data... */ -#if defined(USL) || defined(__uxp__) || defined(linux) +#if defined(USL) || defined(__uxp__) || defined(linux) || defined(CSRG_BASED) (void) memset((void *) &myaddr_in, (int) '\0', sizeof(myaddr_in)); #else (void) memset(myaddr_in, '\0', sizeof(myaddr_in)); -- 2.25.1