summaryrefslogtreecommitdiffstats
path: root/tdecore/kpty.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-05 16:00:42 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-05 16:00:42 -0500
commit03518d6339ad40346fdcf7ab4b66d8eb307a36a8 (patch)
tree55f88ec42581d6d1484db0da8c7ae749d6cc5799 /tdecore/kpty.cpp
parent7cd4adc908abf8c5e3b391c4a88f0514ba8468c4 (diff)
parent3f5a4b419f7907ba61c6f63458e0413cccb74760 (diff)
downloadtdelibs-03518d6339ad40346fdcf7ab4b66d8eb307a36a8.tar.gz
tdelibs-03518d6339ad40346fdcf7ab4b66d8eb307a36a8.zip
Merge branch 'master' of https://scm.trinitydesktop.org/scm/git/tdelibs
Diffstat (limited to 'tdecore/kpty.cpp')
-rw-r--r--tdecore/kpty.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tdecore/kpty.cpp b/tdecore/kpty.cpp
index a94204241..7f27f02f8 100644
--- a/tdecore/kpty.cpp
+++ b/tdecore/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__)
TDEProcess proc;
proc << locate("exe", BASE_CHOWN) << (grant?"--grant":"--revoke") << TQString::number(d->masterFd);
return proc.start(TDEProcess::Block) && proc.normalExit() && !proc.exitStatus();
+#endif
}