From b23b1f35930ed0d10fef42a23f88a2dacd29d91c Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 27 Jul 2005 00:15:46 +0000 Subject: Fix xconsole build break on AIX caused by removal of ptyx defines. --- xconsole.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'xconsole.c') diff --git a/xconsole.c b/xconsole.c index a3f9aa9..381bedc 100644 --- a/xconsole.c +++ b/xconsole.c @@ -159,6 +159,10 @@ static XrmOptionDescRec options[] = { # endif #endif +#if defined(_AIX) +# define USE_PTS +#endif + #if !defined (USE_FILE) || defined (linux) # include # ifdef hpux @@ -186,11 +190,37 @@ static char ttydev[64], ptydev[64]; #ifdef USE_PTY static int get_pty(int *pty, int *tty, char *ttydev, char *ptydev); #endif + #ifdef USE_OSM static FILE *osm_pipe(void); static int child_pid; #endif +/* Copied from xterm/ptyx.h */ +#ifndef PTYCHAR1 +#ifdef __hpux +#define PTYCHAR1 "zyxwvutsrqp" +#else /* !__hpux */ +#ifdef __UNIXOS2__ +#define PTYCHAR1 "pq" +#else +#define PTYCHAR1 "pqrstuvwxyzPQRSTUVWXYZ" +#endif /* !__UNIXOS2__ */ +#endif /* !__hpux */ +#endif /* !PTYCHAR1 */ + +#ifndef PTYCHAR2 +#ifdef __hpux +#define PTYCHAR2 "fedcba9876543210" +#else /* !__hpux */ +#ifdef __FreeBSD__ +#define PTYCHAR2 "0123456789abcdefghijklmnopqrstuv" +#else /* !__FreeBSD__ */ +#define PTYCHAR2 "0123456789abcdef" +#endif /* !__FreeBSD__ */ +#endif /* !__hpux */ +#endif /* !PTYCHAR2 */ + #ifdef Lynx static void RestoreConsole(void) @@ -792,7 +822,11 @@ static int get_pty(int *pty, int *tty, char *ttydev, char *ptydev) { #if defined (SVR4) || defined (USE_PTS) +#if defined (_AIX) + if ((*pty = open ("/dev/ptc", O_RDWR)) < 0) +#else if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0) +#endif return 1; grantpt(*pty); unlockpt(*pty); @@ -928,7 +962,11 @@ osm_pipe(void) if (access(OSM_DEVICE, R_OK) < 0) return NULL; +#if defined (_AIX) + if ((tty = open("/dev/ptc", O_RDWR)) < 0) +#else if ((tty = open("/dev/ptmx", O_RDWR)) < 0) +#endif return NULL; grantpt(tty); -- cgit v1.2.3