diff --git a/src/initdsp.c b/src/initdsp.c index 41bc8dc..4e2ed04 100644 --- a/src/initdsp.c +++ b/src/initdsp.c @@ -108,8 +108,8 @@ int oldred[2], oldgreen[2], oldblue[2]; #endif /* DISPLAYBUFFER */ #endif /* NOPIXRECT */ -int LispWindowFd; -int FrameBufferFd; +int LispWindowFd = -1; +int FrameBufferFd = -1; int displaywidth, displayheight, DisplayRasterWidth, DisplayType; int DisplayByteSize; diff --git a/src/initkbd.c b/src/initkbd.c index 07c960e..ce9da16 100644 --- a/src/initkbd.c +++ b/src/initkbd.c @@ -123,7 +123,7 @@ extern struct screen LispScreen; #endif /* SUNDISPLAY */ extern int LispWindowFd; -int LispKbdFd; +int LispKbdFd = -1; extern int errno; /* for debug */ diff --git a/src/keyevent.c b/src/keyevent.c index 3d03610..35fda58 100644 --- a/src/keyevent.c +++ b/src/keyevent.c @@ -124,11 +124,11 @@ extern fd_set LispIOFds; fd_set LispReadFds; int XNeedSignal = 0; /* T if an X interrupt happened while XLOCK asserted */ +extern int LogFileFd; + #ifdef NOETHER -extern u_int LogFileFd; #else extern int ether_fd; -extern u_int LogFileFd; #endif /* NOETHER */ extern DLword *DisplayRegion68k; @@ -316,7 +316,7 @@ getmore: */ #ifdef SUNDISPLAY - if (FD_ISSET(LispWindowFd, &rfds)) { + if (LispWindowFd >= 0 && FD_ISSET(LispWindowFd, &rfds)) { /* #endif */ while (input_readevent(LispWindowFd, &event) >= 0) { /*if(!kb_event( &event )) {goto getmore;};*/ @@ -341,19 +341,19 @@ getmore: #ifdef NOETHER #else - if (FD_ISSET(ether_fd, &rfds)) { /* Raw ethernet (NIT) I/O happened, so handle it. */ + if (ether_fd >= 0 && FD_ISSET(ether_fd, &rfds)) { /* Raw ethernet (NIT) I/O happened, so handle it. */ DBPRINT(("Handling enet interrupt.\n\n")); check_ether(); } #endif /* NOETHER */ #ifdef RS232 - if (FD_ISSET(RS232C_Fd, &rfds) || (RS232C_remain_data && rs232c_lisp_is_ready())) + if (RS232C_Fd >= 0 && (FD_ISSET(RS232C_Fd, &rfds) || (RS232C_remain_data && rs232c_lisp_is_ready()))) rs232c_read(); #endif /* RS232 */ #ifdef LOGINT - if (FD_ISSET(LogFileFd, &rfds)) { /* There's info in the log file. Tell Lisp to print it. */ + if (LogFileFd >= 0 && FD_ISSET(LogFileFd, &rfds)) { /* There's info in the log file. Tell Lisp to print it. */ flush_pty(); /* move the msg(s) to the log file */ ((INTSTAT *)Addr68k_from_LADDR(*INTERRUPTSTATE_word))->LogFileIO = 1; diff --git a/src/osmsg.c b/src/osmsg.c index bf7f015..3166202 100644 --- a/src/osmsg.c +++ b/src/osmsg.c @@ -64,7 +64,7 @@ int log_id; int previous_size; int logChanged; /* T if log file has changed since last READ */ /* Set by flush_pty, to avoid the stat call */ -u_int LogFileFd; +int LogFileFd = -1; extern fd_set LispReadFds; /************************************************************************/ diff --git a/src/rs232c.c b/src/rs232c.c index 8790f2e..6f136af 100644 --- a/src/rs232c.c +++ b/src/rs232c.c @@ -29,7 +29,7 @@ static DLword *RS232CGetCSB, *RS232CPutCSB; * File descriptor */ extern fd_set LispReadFds; -int RS232C_Fd; +int RS232C_Fd = -1; int RS232C_remain_data; static char *RS232C_Dev; diff --git a/src/timer.c b/src/timer.c index b50ba46..dba2307 100644 --- a/src/timer.c +++ b/src/timer.c @@ -460,7 +460,7 @@ int TIMER_INTERVAL = 25000; int FileIOFlag = 0; int TimerFlag = 0; -extern u_int LispWindowFd; +extern int LispWindowFd; /************************************************************************/ /* */ diff --git a/src/tty.c b/src/tty.c index 3be69b7..a0cc488 100644 --- a/src/tty.c +++ b/src/tty.c @@ -18,7 +18,7 @@ DLTTY_IN_CSB *DLTTYIn; DLTTY_OUT_CSB *DLTTYOut; char *TTY_Dev; -int TTY_Fd; +int TTY_Fd = -1; extern fd_set LispReadFds; struct sgttyb TTY_Mode; diff --git a/src/xinit.c b/src/xinit.c index 7ed4d18..0177882 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -99,9 +99,6 @@ void init_Xevent(DspInterface dsp) XSelectInput(dsp->display_id, dsp->SWGrav, GravMask); XSelectInput(dsp->display_id, dsp->NWGrav, GravMask); -#if defined(OS5) && defined(I_SETSIG) - ioctl(ConnectionNumber(dsp->display_id), I_SETSIG, S_INPUT); /* so we see X events fast */ -#endif } /*end init_Xevent */ /************************************************************************/