]> andersk Git - openssh.git/commitdiff
- (djm) Check for SCO pty naming style (ptyp%d/ttyp%d). Based on fix from
authordjm <djm>
Tue, 29 Aug 2000 00:52:38 +0000 (00:52 +0000)
committerdjm <djm>
Tue, 29 Aug 2000 00:52:38 +0000 (00:52 +0000)
   Bastian Trompetter <btrompetter@firemail.de>

ChangeLog
pty.c

index 79bdcd50266cd74af67b6f7aae5ced46b1af0fa6..558600b30c11c77a28f21ed5858bfddf23402bb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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]
diff --git a/pty.c b/pty.c
index a6c238bd943cd8d83a075e4d62de900172d069e3..f5bb861242ba5cfe9cf754fbd21d7534c6158ba9 100644 (file)
--- a/pty.c
+++ b/pty.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) {
This page took 0.074145 seconds and 5 git commands to generate.