1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

OpenBSD fixes for lib/DtTerm: values.h, #ifdef's and some constants that are not defined on BSD. Also, leave out utmp stuff that does not work on BSD. Note that this terminal allocation does not work properly yet, but this will be fixed later.

This commit is contained in:
Pascal Stumpf 2012-08-09 23:53:47 +02:00 committed by Jon Trulson
parent f5a8836bff
commit 19647809e4
9 changed files with 43 additions and 8 deletions

View file

@ -57,7 +57,11 @@ static char rcs_id[] = "$TOG: TermParse.c /main/3 1999/10/15 12:25:13 mgreess $"
*/
#undef MAXINT
#endif
#include <values.h>
#if defined(CSRG_BASED)
#define MAXSHORT SHRT_MAX
#else
#include <values.h>
#endif
#if defined(USL) || defined(__uxp__)
#include <ctype.h>

View file

@ -44,7 +44,7 @@
#include <Xm/Xm.h>
#include <X11/Xos.h>
#if defined(linux) || defined(UXPArchitecture) || (defined(USL) && (OSMAJORVERSION > 1))
#if defined(linux) || defined(UXPArchitecture) || (defined(USL) && (OSMAJORVERSION > 1)) || defined(CSRG_BASED)
#define _NFILE FOPEN_MAX
#endif

View file

@ -166,7 +166,7 @@ static struct _pty_dirs {
{PTY_null, PTY_null, PTY_null, PTY_null, PTY_null, False},
};
#ifdef ALPHA_ARCHITECTURE
#if defined(ALPHA_ARCHITECTURE) || defined(OpenBSDArchitecture)
/* Use openpty() to open Master/Slave pseudo-terminal pair */
/* Current version of openpty() uses non-STREAM device. BSD name space */
#define TTYNAMELEN 25
@ -254,7 +254,11 @@ GetPty(char **ptySlave, char **ptyMaster)
* name for the tty that everyone else will
* use...
*/
#if defined(XTHREADS)
if (c1 = _XTtyname(ttyFd, tty_buf)) {
#else
if (c1 = _XTtyname(ttyFd)) {
#endif
ttyDev = realloc(ttyDev, strlen(c1) + 1);
(void) strcpy(ttyDev, c1);
}

View file

@ -96,6 +96,12 @@
# define USE_TCSENDBREAK /* use tiocbreak() */
#endif /* LINUX_ARCHITECTURE */
#ifdef OPENBSD_ARCHITECTURE
# define HAS_SETEUID /* seteuid available */
# define HAS_SETREUID /* setreuid available */
# define USE_TCSENDBREAK /* use tiocbreak() */
#endif /* OPENBSD_ARCHITECTURE */
#ifdef SUN_ARCHITECTURE
# define XOR_CAPS_LOCK /* xor caps lock and shift */
# define USE_SRIOCSREDIR /* use SRIOCSREDIR ioctl for -C */

View file

@ -47,7 +47,11 @@ static char rcs_id[] = "$TOG: TermPrimParser.c /main/2 1999/10/15 12:23:41 mgree
*/
#undef MAXINT
#endif
#include <values.h>
#if defined(CSRG_BASED)
#define MAXINT INT_MAX
#else
#include <values.h>
#endif
#ifdef BBA
#pragma BBA_IGNORE

View file

@ -109,6 +109,17 @@ static char rcs_id[] = "$TOG: TermPrimSetPty.c /main/2 1998/04/03 17:11:24 mgree
#define XTTYMODE_weras 14
#define XTTYMODE_lnext 15
#define NXTTYMODES 16
#if defined(CSRG_BASED)
#define TAB3 0x00000000
#define NLDLY 0x00000000
#define CRDLY 0x00000000
#define TABDLY 0x00000000
#define BSDLY 0x00000000
#define VTDLY 0x00000000
#define FFDLY 0x00000000
#define CBAUD 0x00000000
#endif
typedef struct _ttyMode
{
char *name;

View file

@ -332,6 +332,7 @@ _DtTermPrimUtmpGetUtLine(int pty, char *ptyName)
static char *
UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
{
#if !defined(CSRG_BASED) /* XXX */
DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w;
struct termData *tpd = tw->term.tpd;
struct utmp ut;
@ -489,6 +490,9 @@ UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
/* failure... */
(void) endutent();
return((char *) 0);
#else /* __OpenBSD__ */
return(utmpLine);
#endif
}
/* this is a public wrapper around the previous function that runs the
@ -511,6 +515,7 @@ _DtTermPrimUtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
static void
UtmpEntryDestroy(Widget w, char *utmpLine)
{
#if !defined(CSRG_BASED)
struct utmp ut;
struct utmp *utPtr;
time_t now;
@ -537,6 +542,7 @@ UtmpEntryDestroy(Widget w, char *utmpLine)
(void) endutent();
(void) DeleteUtmpInfo(utmpLine);
#endif /* !__OpenBSD__ */
}
/* this is a public wrapper around the previous function that runs the

View file

@ -38,7 +38,7 @@ static char rcs_id[] = "$TOG: TermPrimSubproc.c /main/11 1998/04/20 12:45:57 mgr
#include "TermHeader.h"
#include <fcntl.h>
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_ARCHITECTURE) || defined(LINUX_ARCHITECTURE)
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
/* For TIOCSTTY definitions */
#include <sys/ioctl.h>
#endif /* ALPHA_ARCHITECTURE */
@ -461,7 +461,7 @@ _DtTermPrimSubprocExec(Widget w,
/* child...
*/
_DtTermProcessUnlock();
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_ARCHITECTURE) || defined(LINUX_ARCHITECTURE)
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
/* establish a new session for child */
setsid();
#else
@ -482,7 +482,7 @@ _DtTermPrimSubprocExec(Widget w,
(void) _exit(1);
}
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_ARCHITECTURE) || defined(LINUX_ARCHITECTURE)
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
/* BSD needs to do this to acquire pty as controlling terminal */
if (ioctl(pty, TIOCSCTTY, (char *)NULL) < 0) {
(void) close(pty);

View file

@ -462,7 +462,7 @@ _DtTermPrimStartLog(Widget w)
** reset signals
*/
(void) signal(SIGHUP, SIG_DFL);
(void) signal(SIGCLD, SIG_DFL);
(void) signal(SIGCHLD, SIG_DFL);
#ifdef BBA
_bA_dump();
#endif /* BBA */