* 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
+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
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. */
#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