summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2005-07-27 00:15:46 +0000
committerDaniel Stone <daniel@fooishbar.org>2005-07-27 00:15:46 +0000
commitb23b1f35930ed0d10fef42a23f88a2dacd29d91c (patch)
treee114e4ecff5378bffe91adee367108d7d4ca687c
parentb471e2609662c2ec83d26ee32a7900e528f67f75 (diff)
downloadxconsole-b23b1f35930ed0d10fef42a23f88a2dacd29d91c.tar.gz
xconsole-b23b1f35930ed0d10fef42a23f88a2dacd29d91c.tar.bz2
xconsole-b23b1f35930ed0d10fef42a23f88a2dacd29d91c.zip
Fix xconsole build break on AIX caused by removal of ptyx defines.XORG-6_8_99_900
-rw-r--r--xconsole.c38
1 files changed, 38 insertions, 0 deletions
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 <sys/ioctl.h>
# 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);