From 1b88e35b80b8fe26c33046d7a9d884fc615ead2d Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 22 Oct 1995 19:11:12 +0000 Subject: Update to 4.4lite2 (clean up includes; initialize the name of the master pty correctly (it was broken for calls to openpty() after the first successful one)). Obtained from: 4.4lite2 --- lib/libutil/pty.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/libutil/pty.c') diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index a6d08f612287..5aecbfbf2f79 100644 --- a/lib/libutil/pty.c +++ b/lib/libutil/pty.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1990, 1993 + * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,20 +32,21 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; +static char sccsid[] = "@(#)pty.c 8.3 (Berkeley) 5/16/94"; #endif /* LIBC_SCCS and not lint */ -#include #include -#include #include -#include -#include +#include + #include -#include +#include +#include #include +#include #include -#include +#include +#include openpty(amaster, aslave, name, termp, winp) int *amaster, *aslave; @@ -66,6 +67,7 @@ openpty(amaster, aslave, name, termp, winp) for (cp1 = "pqrsPQRS"; *cp1; cp1++) { line[8] = *cp1; for (cp2 = "0123456789abcdefghijklmnopqrstuv"; *cp2; cp2++) { + line[5] = 'p'; line[9] = *cp2; if ((master = open(line, O_RDWR, 0)) == -1) { if (errno == ENOENT) @@ -89,7 +91,6 @@ openpty(amaster, aslave, name, termp, winp) return (0); } (void) close(master); - line[5] = 'p'; } } } -- cgit v1.2.3