summaryrefslogtreecommitdiff
path: root/lib/libutil/pty.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-29 18:44:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-29 18:44:18 +0000
commita83ba9b304f4240402576d0d1314f1b728875871 (patch)
tree1a40602fe560197d8e4a022430a1bdbd712ec57b /lib/libutil/pty.c
parent7aacf51d473d7df05e0b08c055457e6819115c2f (diff)
fix multiple invocations; from tlb@viaweb.com
Diffstat (limited to 'lib/libutil/pty.c')
-rw-r--r--lib/libutil/pty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c
index fa2c1cadfbd..b88424defcf 100644
--- a/lib/libutil/pty.c
+++ b/lib/libutil/pty.c
@@ -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
* The Regents of the University of California. All rights reserved.
@@ -34,7 +34,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* 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 */
#include <sys/cdefs.h>
@@ -79,6 +79,7 @@ openpty(amaster, aslave, name, termp, winp)
line[8] = *cp1;
for (cp2 = "0123456789abcdef"; *cp2; cp2++) {
line[9] = *cp2;
+ line[5] = 'p';
if ((master = open(line, O_RDWR, 0)) == -1) {
if (errno == ENOENT)
return (-1); /* out of ptys */
@@ -101,7 +102,6 @@ openpty(amaster, aslave, name, termp, winp)
return (0);
}
(void) close(master);
- line[5] = 'p';
}
}
}