Browse Source

fix multiple invocations; from tlb@viaweb.com

OPENBSD_2_0
deraadt 28 years ago
parent
commit
17fdcd3488
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/lib/libutil/pty.c

+ 3
- 3
src/lib/libutil/pty.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: pty.c,v 1.3 1996/06/17 07:46:05 downsj Exp $ */
/* $OpenBSD: pty.c,v 1.4 1996/06/29 18:44:17 deraadt Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -34,7 +34,7 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
/* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */ /* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */
static char *rcsid = "$Id: pty.c,v 1.3 1996/06/17 07:46:05 downsj Exp $";
static char *rcsid = "$Id: pty.c,v 1.4 1996/06/29 18:44:17 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h> #include <sys/cdefs.h>
@ -79,6 +79,7 @@ openpty(amaster, aslave, name, termp, winp)
line[8] = *cp1; line[8] = *cp1;
for (cp2 = "0123456789abcdef"; *cp2; cp2++) { for (cp2 = "0123456789abcdef"; *cp2; cp2++) {
line[9] = *cp2; line[9] = *cp2;
line[5] = 'p';
if ((master = open(line, O_RDWR, 0)) == -1) { if ((master = open(line, O_RDWR, 0)) == -1) {
if (errno == ENOENT) if (errno == ENOENT)
return (-1); /* out of ptys */ return (-1); /* out of ptys */
@ -101,7 +102,6 @@ openpty(amaster, aslave, name, termp, winp)
return (0); return (0);
} }
(void) close(master); (void) close(master);
line[5] = 'p';
} }
} }
} }


Loading…
Cancel
Save