diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | pty.c | 13 |
2 files changed, 12 insertions, 3 deletions
@@ -2,6 +2,8 @@ | |||
2 | - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert | 2 | - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert |
3 | Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and | 3 | Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and |
4 | Garrick James <garrick@james.net> | 4 | Garrick James <garrick@james.net> |
5 | - (djm) Check for SCO pty naming style (ptyp%d/ttyp%d). Based on fix from | ||
6 | Bastian Trompetter <btrompetter@firemail.de> | ||
5 | - More OpenBSD updates: | 7 | - More OpenBSD updates: |
6 | - deraadt@cvs.openbsd.org 2000/08/24 15:46:59 | 8 | - deraadt@cvs.openbsd.org 2000/08/24 15:46:59 |
7 | [scp.c] | 9 | [scp.c] |
@@ -162,12 +162,19 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) | |||
162 | for (i = 0; i < num_ptys; i++) { | 162 | for (i = 0; i < num_ptys; i++) { |
163 | snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], | 163 | snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], |
164 | ptyminors[i % num_minors]); | 164 | ptyminors[i % num_minors]); |
165 | *ptyfd = open(buf, O_RDWR | O_NOCTTY); | ||
166 | if (*ptyfd < 0) | ||
167 | continue; | ||
168 | snprintf(namebuf, namebuflen, "/dev/tty%c%c", | 165 | snprintf(namebuf, namebuflen, "/dev/tty%c%c", |
169 | ptymajors[i / num_minors], ptyminors[i % num_minors]); | 166 | ptymajors[i / num_minors], ptyminors[i % num_minors]); |
170 | 167 | ||
168 | *ptyfd = open(buf, O_RDWR | O_NOCTTY); | ||
169 | if (*ptyfd < 0) { | ||
170 | /* Try SCO style naming */ | ||
171 | snprintf(buf, sizeof buf, "/dev/ptyp%d", i); | ||
172 | snprintf(namebuf, namebuflen, "/dev/ttyp%d", i); | ||
173 | *ptyfd = open(buf, O_RDWR | O_NOCTTY); | ||
174 | if (*ptyfd < 0) | ||
175 | continue; | ||
176 | } | ||
177 | |||
171 | /* Open the slave side. */ | 178 | /* Open the slave side. */ |
172 | *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); | 179 | *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); |
173 | if (*ttyfd < 0) { | 180 | if (*ttyfd < 0) { |