aboutsummaryrefslogtreecommitdiff
path: root/lib/libutil/pty.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-10-22 19:11:12 +0000
committerBruce Evans <bde@FreeBSD.org>1995-10-22 19:11:12 +0000
commit1b88e35b80b8fe26c33046d7a9d884fc615ead2d (patch)
tree548025a58173e0dac8a982dfc7af88dddd484904 /lib/libutil/pty.c
parente3965e5b67ed3d5d6809be3666bec1930e175924 (diff)
downloadsrc-1b88e35b80b8fe26c33046d7a9d884fc615ead2d.tar.gz
src-1b88e35b80b8fe26c33046d7a9d884fc615ead2d.zip
Notes
Diffstat (limited to 'lib/libutil/pty.c')
-rw-r--r--lib/libutil/pty.c19
1 files changed, 10 insertions, 9 deletions
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 <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';
}
}
}