Commit 96b137d2 authored by Niels Möller's avatar Niels Möller
Browse files

(pty_open_slave): Work around Solaris problem with bogus definition of

TIOCSCTTY.

Rev: src/server_pty.c:1.36
parent eb346af1
...@@ -38,6 +38,16 @@ ...@@ -38,6 +38,16 @@
# include <stropts.h> /* isastream() */ # include <stropts.h> /* isastream() */
#endif #endif
/* Kludge... On Solaris, including termios.h brings in a compatibility
definition of TIOCSCTTY, which doesn't work. So check if it's
defined before the includes that bring in termios.h. */
#ifdef TIOCSCTTY
# define HAVE_TIOCSCTTY 1
#else
# define HAVE_TIOCSCTTY 0
#endif
#include "server_pty.h" #include "server_pty.h"
#include "channel.h" #include "channel.h"
...@@ -169,7 +179,7 @@ pty_open_slave(struct pty_info *pty) ...@@ -169,7 +179,7 @@ pty_open_slave(struct pty_info *pty)
/* On BSD systems, use TIOCSCTTY. */ /* On BSD systems, use TIOCSCTTY. */
#ifdef TIOCSCTTY #if HAVE_TIOCSCTTY
if (ioctl(fd, TIOCSCTTY, NULL) < 0) if (ioctl(fd, TIOCSCTTY, NULL) < 0)
{ {
werror("pty_open_slave: Failed to set the controlling tty: %e.\n", errno); werror("pty_open_slave: Failed to set the controlling tty: %e.\n", errno);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment