summaryrefslogtreecommitdiff
path: root/lib/libutil
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-04-11 18:04:37 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-04-11 18:04:37 +0000
commit19d8d54e816b8d0063b5c61ec12e6a06654c8680 (patch)
treecbfe0ae7fd35212c8aa6a5e3f2ba3ca0dcb8ed0f /lib/libutil
parent8e9986215e5b1150f8af7a608f822ba91d1a5096 (diff)
Crank max ptys to 992. We now have 62 pty/tty pairs for each letter
instead of 16. E.g. it is now /dev/{p,t}typ[0-9a-zA-z] instead of just /dev/{p,t}typ[0-9a-f]. This requires that you update MAKEDEV and run: # cd /dev && ./MAKEDEV pty0 && rm -f [pt]ty[rq]*
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/pty.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c
index a8fa7671537..bd6fa2cfb8c 100644
--- a/lib/libutil/pty.c
+++ b/lib/libutil/pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pty.c,v 1.11 2004/02/10 01:31:20 millert Exp $ */
+/* $OpenBSD: pty.c,v 1.12 2004/04/11 18:04:36 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,7 +30,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */
-static const char rcsid[] = "$Id: pty.c,v 1.11 2004/02/10 01:31:20 millert Exp $";
+static const char rcsid[] = "$Id: pty.c,v 1.12 2004/04/11 18:04:36 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
@@ -49,6 +49,7 @@ static const char rcsid[] = "$Id: pty.c,v 1.11 2004/02/10 01:31:20 millert Exp $
#include "util.h"
#define TTY_LETTERS "pqrstuvwxyzPQRST"
+#define TTY_SUFFIX "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
int
openpty(amaster, aslave, name, termp, winp)
@@ -58,8 +59,8 @@ openpty(amaster, aslave, name, termp, winp)
struct winsize *winp;
{
char line[] = "/dev/ptyXX";
- register const char *cp1, *cp2;
- register int master, slave, ttygid;
+ const char *cp1, *cp2;
+ int master, slave, ttygid;
struct group *gr;
struct ptmget ptm;
int fd;
@@ -103,7 +104,7 @@ openpty(amaster, aslave, name, termp, winp)
for (cp1 = TTY_LETTERS; *cp1; cp1++) {
line[8] = *cp1;
- for (cp2 = "0123456789abcdef"; *cp2; cp2++) {
+ for (cp2 = TTY_SUFFIX; *cp2; cp2++) {
line[9] = *cp2;
line[5] = 'p';
if ((master = open(line, O_RDWR, 0)) == -1) {