diff options
author | François Andriot <francois.andriot@free.fr> | 2014-10-05 16:28:01 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:22:50 +0100 |
commit | 4ade6a8e209a5fe09a78abcc9fdd016720982537 (patch) | |
tree | 65eeb5641d117dad22423115cfc13413d0f95b77 /kdecore | |
parent | e4213f01b9eaa5100c31d497f15d87695d18f4cd (diff) | |
download | tdelibs-4ade6a8e209a5fe09a78abcc9fdd016720982537.tar.gz tdelibs-4ade6a8e209a5fe09a78abcc9fdd016720982537.zip |
Add support for openbsd pty in kpty
(cherry picked from commit e61585edf09d3136c92e255e26dc054d3e22cd7d)
Diffstat (limited to 'kdecore')
-rw-r--r-- | kdecore/kpty.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kdecore/kpty.cpp b/kdecore/kpty.cpp index 6367357c3..bfa5659c1 100644 --- a/kdecore/kpty.cpp +++ b/kdecore/kpty.cpp @@ -305,6 +305,17 @@ bool KPty::open() if (d->masterFd >= 0) return true; +#if defined(__OpenBSD__) + char cpty[16]; + + if (openpty(&d->masterFd, &d->slaveFd, cpty, NULL, &d->winSize) == 0) { + d->ttyName = cpty; + } else { + kdWarning(175) << "Can't open slave pseudo teletype" << endl; + return false; + } +#else + TQCString ptyName; // Find a master pty that we can open //////////////////////////////// @@ -379,6 +390,7 @@ bool KPty::open() kdWarning(175) << "KPty::open(): " << "Can't open a pseudo teletype" << endl; return false; +#endif gotpty: return _attachPty(d->masterFd); @@ -568,8 +580,10 @@ int KPty::slaveFd() const // private bool KPty::chownpty(bool grant) { +#if !defined(__OpenBSD__) KProcess proc; proc << locate("exe", BASE_CHOWN) << (grant?"--grant":"--revoke") << TQString::number(d->masterFd); return proc.start(KProcess::Block) && proc.normalExit() && !proc.exitStatus(); +#endif } |