mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-26 20:02:37 +00:00
Rework handling of I/O via select() to use correct fd_set type instead of int for fd sets.
Some code that was maintaining an fd_set with only a single fd was replaced
with just the fd as int, which can be added to the global fd_set as needed.
More testing is required for less usual configurations such as host TCP/UDP/IP
and direct ethernet (packet filter or NIT) I/O.
modified: src/common.c
modified: src/ether.c
modified: src/inet.c
modified: src/initkbd.c
modified: src/kbdsubrs.c
modified: src/keyevent.c
modified: src/main.c
modified: src/osmsg.c
modified: src/rawrs232c.c
modified: src/rpc.c
modified: src/rs232c.c
modified: src/tty.c
modified: src/uraid.c
modified: src/xinit.c
This commit is contained in:
@@ -10,6 +10,7 @@ static char *id = "$Id: tty.c,v 1.2 1999/01/03 02:07:39 sybalsky Exp $ Copyright
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include <sys/select.h>
|
||||
#include "tty.h"
|
||||
|
||||
DLTTY_OUT_COMMAND *DLTTYPortCmd;
|
||||
@@ -18,7 +19,7 @@ DLTTY_OUT_CSB *DLTTYOut;
|
||||
|
||||
char *TTY_Dev;
|
||||
int TTY_Fd;
|
||||
extern int LispReadFds;
|
||||
extern fd_set LispReadFds;
|
||||
struct sgttyb TTY_Mode;
|
||||
|
||||
void tty_init() {
|
||||
@@ -47,7 +48,7 @@ void tty_open() {
|
||||
TTY_Mode.sg_flags = RAW;
|
||||
stat = ioctl(TTY_Fd, TIOCSETP, &TTY_Mode);
|
||||
|
||||
LispReadFds |= (1 << TTY_Fd);
|
||||
FD_SET(TTY_Fd, &LispReadFds);
|
||||
#ifdef TTYINT
|
||||
int_io_open(TTY_Fd);
|
||||
#endif
|
||||
@@ -66,7 +67,7 @@ void tty_close() {
|
||||
#endif
|
||||
|
||||
if (TTY_Fd >= 0) {
|
||||
LispReadFds &= ~(1 << TTY_Fd);
|
||||
FD_CLR(TTY_Fd, &LispReadFds);
|
||||
stat = close(TTY_Fd);
|
||||
#ifdef TTYINT
|
||||
int_io_close(TTY_Fd);
|
||||
|
||||
Reference in New Issue
Block a user