summaryrefslogtreecommitdiff
path: root/libexec/getty/subr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-10-06 22:51:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-10-06 22:51:43 +0000
commitecbdf567686dc48970a28f4b6b0901edbf52ad9b (patch)
tree04ce97a47470b685f93fa8f772948f00344be77d /libexec/getty/subr.c
parent0fb9e8dd7d85d7437ea0722941e7e76d3e10c3be (diff)
use fd_set instead of int
Diffstat (limited to 'libexec/getty/subr.c')
-rw-r--r--libexec/getty/subr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c
index dcae48d064d..2f1c5390d43 100644
--- a/libexec/getty/subr.c
+++ b/libexec/getty/subr.c
@@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$Id: subr.c,v 1.9 2000/09/08 04:30:19 aaron Exp $";
+static char rcsid[] = "$Id: subr.c,v 1.10 2000/10/06 22:51:42 deraadt Exp $";
#endif /* not lint */
/*
@@ -694,22 +694,22 @@ portselector()
char *
autobaud()
{
- int rfds;
+ fd_set rfds;
struct timeval timeout;
char c, *type = "9600-baud";
(void)tcflush(0, TCIOFLUSH);
- rfds = 1 << 0;
+ FD_ZERO(&rfds);
+ FD_SET(0, &rfds);
timeout.tv_sec = 5;
timeout.tv_usec = 0;
- if (select(32, (fd_set *)&rfds, (fd_set *)NULL,
- (fd_set *)NULL, &timeout) <= 0)
+ if (select(1, &rfds, (fd_set *)NULL, (fd_set *)NULL, &timeout) <= 0)
return (type);
if (read(STDIN_FILENO, &c, sizeof(char)) != sizeof(char))
return (type);
timeout.tv_sec = 0;
timeout.tv_usec = 20;
- (void) select(32, (fd_set *)NULL, (fd_set *)NULL,
+ (void) select(0, (fd_set *)NULL, (fd_set *)NULL,
(fd_set *)NULL, &timeout);
(void)tcflush(0, TCIOFLUSH);
switch (c & 0377) {