summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2001-05-04 04:12:07 +0000
committerTom Yu <tlyu@mit.edu>2001-05-04 04:12:07 +0000
commit1d0c8300e47d13fa26f1016e4c695ae9342f168b (patch)
tree0387f68007e8d9f15d04ba512e577bd6aa1ac9bf /src
parentcb95276178c0977cab6c1bc5351551ccae01fc84 (diff)
downloadkrb5-1d0c8300e47d13fa26f1016e4c695ae9342f168b.tar.gz
krb5-1d0c8300e47d13fa26f1016e4c695ae9342f168b.tar.xz
krb5-1d0c8300e47d13fa26f1016e4c695ae9342f168b.zip
* pty-int.h: Fix typo; VHANG_first -> VHANG_FIRST
* open_slave.c (pty_open_slave): Add workaround for Tru64 v5.0, since its revoke() will fail if the slave isn't open already. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13229 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/pty/ChangeLog7
-rw-r--r--src/util/pty/open_slave.c13
-rw-r--r--src/util/pty/pty-int.h9
3 files changed, 27 insertions, 2 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index 51e5188cf..42f3a69eb 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-04 Tom Yu <tlyu@mit.edu>
+
+ * pty-int.h: Fix typo; VHANG_first -> VHANG_FIRST.
+
+ * open_slave.c (pty_open_slave): Add workaround for Tru64 v5.0,
+ since its revoke() will fail if the slave isn't open already.
+
2001-05-03 Ezra Peisach <epeisach@rna.mit.edu>
* sane_hostname.c (pty_make_sane_hostname): Preserve const
diff --git a/src/util/pty/open_slave.c b/src/util/pty/open_slave.c
index b8c332603..0e863d96a 100644
--- a/src/util/pty/open_slave.c
+++ b/src/util/pty/open_slave.c
@@ -78,9 +78,22 @@ long pty_open_slave ( slave, fd)
return retval;
#ifdef HAVE_REVOKE
+#if defined(O_NOCTTY) && !defined(OPEN_CTTY_ONLY_ONCE)
+ /*
+ * Some OSes, notably Tru64 v5.0, fail on revoke() if the slave
+ * isn't open. Since we don't want to acquire it as controlling
+ * tty yet, use O_NOCTTY if available.
+ */
+ vfd = open(slave, O_RDWR | O_NOCTTY);
+ if (vfd < 0)
+ return PTY_OPEN_SLAVE_OPENFAIL;
+#endif
if (revoke (slave) < 0 ) {
return PTY_OPEN_SLAVE_REVOKEFAIL;
}
+#if defined(O_NOCTTY) && !defined(OPEN_CTTY_ONLY_ONCE)
+ close(vfd);
+#endif
#endif /*HAVE_REVOKE*/
/* Open the pty for real. */
diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h
index fa7f828f4..3f9d2cea3 100644
--- a/src/util/pty/pty-int.h
+++ b/src/util/pty/pty-int.h
@@ -85,8 +85,13 @@
#endif
#endif
-#if defined(HAVE_VHANGUP) && !defined(OPEN_CTTY_ONLY_ONCE)
-#define VHANG_first /* Breaks under Ultrix and others where you cannot get controlling terminal twice.*/
+#if defined(HAVE_VHANGUP) && !defined(OPEN_CTTY_ONLY_ONCE) \
+ && !defined(HAVE_REVOKE)
+/*
+ * Breaks under Ultrix and others where you cannot get controlling
+ * terminal twice.
+ */
+#define VHANG_FIRST
#define VHANG_LAST
#endif