From 7efb4cb879f4dca396c48edd1273e194ca402e3f Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 3 Oct 2000 19:57:30 +0000 Subject: [PATCH] Patch for AIX by Reza Arbab svn path=/trunk/kdebase/konsole/; revision=66299 --- src/TEPty.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/TEPty.C b/src/TEPty.C index b6df6dde..be9c5ad9 100644 --- a/src/TEPty.C +++ b/src/TEPty.C @@ -78,6 +78,11 @@ #include #endif +#ifdef _AIX +#define _ALL_SOURCE +#include +#endif + #include #include @@ -285,7 +290,11 @@ int TEPty::openPty() #if defined(HAVE_GRANTPT) && defined(HAVE_PTSNAME) if (ptyfd < 0) { +#ifdef _AIX + ptyfd = open("/dev/ptc",O_RDWR); +#else ptyfd = open("/dev/ptmx",O_RDWR); +#endif if (ptyfd >= 0) { strncpy(ttynam, ptsname(ptyfd), 50); @@ -465,7 +474,11 @@ void TEPty::makePty(const char* dev, const char* pgm, QStrList & args, const cha #endif int pgrp = getpid(); // This sequence is necessary for +#ifdef _AIX + tcsetpgrp (0, pgrp); +#else ioctl(0, TIOCSPGRP, (char *)&pgrp); // event propagation. Omitting this +#endif setpgid(0,0); // is not noticeable with all close(open(dev, O_WRONLY, 0)); // clients (bash,vi). Because bash setpgid(0,0); // heals this, use '-e' to test it.