summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/bsd-openpty.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2019-04-26 10:06:34 +0200
committerDarren Tucker <dtucker@dtucker.net>2019-04-26 10:06:34 +0200
commitb7b8334914fb9397a6725f3b5d2de999b0bb69ac (patch)
tree5902f06bfeacee174ee8bf48087a67e7757a8c3f /openbsd-compat/bsd-openpty.c
parentmakedepend (diff)
downloadopenssh-b7b8334914fb9397a6725f3b5d2de999b0bb69ac.tar.xz
openssh-b7b8334914fb9397a6725f3b5d2de999b0bb69ac.zip
Don't install duplicate STREAMS modules on Solaris
Check if STREAMS modules are already installed on pty before installing since when compiling with XPG>=4 they will likely be installed already. Prevents hangs and duplicate lines on the terminal. bz#2945 and bz#2998, patch from djm@
Diffstat (limited to '')
-rw-r--r--openbsd-compat/bsd-openpty.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c
index e8ad542f8..123a9be56 100644
--- a/openbsd-compat/bsd-openpty.c
+++ b/openbsd-compat/bsd-openpty.c
@@ -121,6 +121,15 @@ openpty(int *amaster, int *aslave, char *name, struct termios *termp,
return (-1);
}
+# if defined(I_FIND) && defined(__SVR4)
+ /*
+ * If the streams modules have already been pushed then there
+ * is no more work to do here.
+ */
+ if (ioctl(*aslave, I_FIND, "ptem") != 0)
+ return 0;
+# endif
+
/*
* Try to push the appropriate streams modules, as described
* in Solaris pts(7).