Deleted Added
full compact
bsd-openpty.c (126274) bsd-openpty.c (146998)
1/*
2 * Please note: this implementation of openpty() is far from complete.
3 * it is just enough for portable OpenSSH's needs.
4 */
5
6/*
7 * Copyright (c) 2004 Damien Miller <djm@mindrot.org>
8 *

--- 88 unchanged lines hidden (view full) ---

97 *amaster = ptm;
98
99 /* Open the slave side. */
100 if ((*aslave = open(pts, O_RDWR | O_NOCTTY)) == -1) {
101 close(*amaster);
102 return (-1);
103 }
104
1/*
2 * Please note: this implementation of openpty() is far from complete.
3 * it is just enough for portable OpenSSH's needs.
4 */
5
6/*
7 * Copyright (c) 2004 Damien Miller <djm@mindrot.org>
8 *

--- 88 unchanged lines hidden (view full) ---

97 *amaster = ptm;
98
99 /* Open the slave side. */
100 if ((*aslave = open(pts, O_RDWR | O_NOCTTY)) == -1) {
101 close(*amaster);
102 return (-1);
103 }
104
105#ifndef HAVE_CYGWIN
106 /*
107 * Try to push the appropriate streams modules, as described
108 * in Solaris pts(7).
109 */
110 ioctl(*aslave, I_PUSH, "ptem");
111 ioctl(*aslave, I_PUSH, "ldterm");
112# ifndef __hpux
113 ioctl(*aslave, I_PUSH, "ttcompat");
114# endif /* __hpux */
105 /*
106 * Try to push the appropriate streams modules, as described
107 * in Solaris pts(7).
108 */
109 ioctl(*aslave, I_PUSH, "ptem");
110 ioctl(*aslave, I_PUSH, "ldterm");
111# ifndef __hpux
112 ioctl(*aslave, I_PUSH, "ttcompat");
113# endif /* __hpux */
115#endif /* HAVE_CYGWIN */
116
117 return (0);
118
119#elif defined(HAVE_DEV_PTS_AND_PTC)
120 /* AIX-style pty code. */
121 const char *ttname;
122
123 if ((*amaster = open("/dev/ptc", O_RDWR | O_NOCTTY)) == -1)

--- 80 unchanged lines hidden ---
114
115 return (0);
116
117#elif defined(HAVE_DEV_PTS_AND_PTC)
118 /* AIX-style pty code. */
119 const char *ttname;
120
121 if ((*amaster = open("/dev/ptc", O_RDWR | O_NOCTTY)) == -1)

--- 80 unchanged lines hidden ---