diff options
author | Damien Miller <djm@mindrot.org> | 2000-08-29 11:52:38 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-08-29 11:52:38 +1100 |
commit | 6d8c11f627d75f5e48dfcb23c0fe9e65a7b522eb (patch) | |
tree | bfa3172cf95e9a9cff3bcbd86d41b0cdf7163711 | |
parent | caf6dd6d219e916e2784b3c884a7f2ce8784df37 (diff) |
- (djm) Check for SCO pty naming style (ptyp%d/ttyp%d). Based on fix from
Bastian Trompetter <btrompetter@firemail.de>
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | pty.c | 13 |
2 files changed, 12 insertions, 3 deletions
@@ -2,6 +2,8 @@ - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and Garrick James <garrick@james.net> + - (djm) Check for SCO pty naming style (ptyp%d/ttyp%d). Based on fix from + Bastian Trompetter <btrompetter@firemail.de> - More OpenBSD updates: - deraadt@cvs.openbsd.org 2000/08/24 15:46:59 [scp.c] @@ -162,12 +162,19 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) for (i = 0; i < num_ptys; i++) { snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], ptyminors[i % num_minors]); - *ptyfd = open(buf, O_RDWR | O_NOCTTY); - if (*ptyfd < 0) - continue; snprintf(namebuf, namebuflen, "/dev/tty%c%c", ptymajors[i / num_minors], ptyminors[i % num_minors]); + *ptyfd = open(buf, O_RDWR | O_NOCTTY); + if (*ptyfd < 0) { + /* Try SCO style naming */ + snprintf(buf, sizeof buf, "/dev/ptyp%d", i); + snprintf(namebuf, namebuflen, "/dev/ttyp%d", i); + *ptyfd = open(buf, O_RDWR | O_NOCTTY); + if (*ptyfd < 0) + continue; + } + /* Open the slave side. */ *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); if (*ttyfd < 0) { |