diff options
author | bde <bde@FreeBSD.org> | 1995-10-22 19:11:12 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-10-22 19:11:12 +0000 |
commit | 1c4474b3dde278c2810cc31247de1723cdafda93 (patch) | |
tree | 548025a58173e0dac8a982dfc7af88dddd484904 | |
parent | 0104ec6360f83a3a0a79f6dc3ced4d9d28644878 (diff) | |
download | FreeBSD-src-1c4474b3dde278c2810cc31247de1723cdafda93.zip FreeBSD-src-1c4474b3dde278c2810cc31247de1723cdafda93.tar.gz |
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
-rw-r--r-- | lib/libutil/pty.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index a6d08f6..5aecbfb 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 <sys/cdefs.h> #include <sys/types.h> -#include <sys/stat.h> #include <sys/ioctl.h> -#include <fcntl.h> -#include <termios.h> +#include <sys/stat.h> + #include <errno.h> -#include <unistd.h> +#include <fcntl.h> +#include <grp.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> -#include <grp.h> +#include <termios.h> +#include <unistd.h> 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'; } } } |