From 19f6767e55404846024b9ef76dfdb2f92b5e1a43 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 25 Jan 2021 12:44:42 +0700 Subject: [PATCH] osmsg now uses MAIKO_HANDLE_CONSOLE_MESSAGES (#290) This was checking that neither `DOS` nor `XWINDOW` were defined, but this needs a more specific flag for this feature so that it doesn't get enabled when `!DOS && !XWINDOW`. --- src/osmsg.c | 53 +++++++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/src/osmsg.c b/src/osmsg.c index 3a3e71f..3e77bd0 100644 --- a/src/osmsg.c +++ b/src/osmsg.c @@ -19,23 +19,21 @@ #include "version.h" -#ifndef DOS +#include /* Needed for jmp_buf for timeout.h */ + +#include #include +#include #include +#include #include #include -#include -#include -#ifndef XWINDOW -#include -#endif #include #include -#endif /* DOS */ +#include +#include + -#include -#include -#include #include "lispemul.h" #include "lispmap.h" #include "adr68k.h" @@ -48,6 +46,7 @@ #include "osmsg.h" #include "dbprint.h" +#include "commondefs.h" #include "osmsgdefs.h" #ifdef OS4 @@ -79,8 +78,7 @@ extern fd_set LispReadFds; /************************************************************************/ void mess_init() { -#ifndef XWINDOW -#ifndef DOS +#ifdef MAIKO_HANDLE_CONSOLE_MESSAGES struct passwd *pwd; int ttyfd; int ptyfd, ptynum; @@ -159,8 +157,7 @@ gotpty: #endif previous_size = 0; DBPRINT(("Console logging started.\n")); -#endif /* DOS */ -#endif /* XWINDOW */ +#endif /* MAIKO_HANDLE_CONSOLE_MESSAGES */ } /************************************************************************/ @@ -174,8 +171,7 @@ gotpty: /************************************************************************/ void mess_reset() { -#ifndef DOS -#ifndef XWINDOW +#ifdef MAIKO_HANDLE_CONSOLE_MESSAGES int console_fd; close(log_id); close(cons_tty); @@ -188,8 +184,7 @@ void mess_reset() { close(console_fd); } ***/ -#endif /* XWINDOW */ -#endif /* DOS */ +#endif /* MAIKO_HANDLE_CONSOLE_MESSAGES */ } /************************************************************************/ @@ -202,8 +197,7 @@ void mess_reset() { /* */ /************************************************************************/ LispPTR mess_readp() { -#ifndef DOS -#ifndef XWINDOW +#ifdef MAIKO_HANDLE_CONSOLE_MESSAGES struct stat sbuf; int size; int rval; @@ -224,8 +218,7 @@ LispPTR mess_readp() { * * * * * * * * * * * * * */ if (logChanged) return (ATOM_T); -#endif /* XWINDOW */ -#endif /* DOS */ +#endif /* MAIKO_HANDLE_CONSOLE_MESSAGES */ return (NIL); } @@ -244,9 +237,7 @@ LispPTR mess_readp() { LispPTR mess_read(LispPTR *args) /* args[0] buffer */ { -#if defined(DOS) || defined(XWINDOW) - return (NIL); -#else +#ifdef MAIKO_HANDLE_CONSOLE_MESSAGES struct stat sbuf; int size, save_size; char *base; @@ -303,7 +294,9 @@ LispPTR mess_read(LispPTR *args) StrNCpyFromCToLisp(base, temp_buf, size); return (GetSmallp(size)); -#endif /* DOS | XWINDOW*/ +#else + return (NIL); +#endif /* MAIKO_HANDLE_CONSOLE_MESSAGES */ } /************************************************************************/ @@ -318,9 +311,7 @@ LispPTR mess_read(LispPTR *args) /************************************************************************/ LispPTR flush_pty() { -#if defined(DOS) || defined(XWINDOW) - return (NIL); -#else +#ifdef MAIKO_HANDLE_CONSOLE_MESSAGES struct stat sbuf; char buf[MESSAGE_BUFFER_SIZE]; /* Buffer between pty and log file */ int size; @@ -383,5 +374,7 @@ LispPTR flush_pty() { return (ATOM_T); } } -#endif /* XWINDOW | DOS */ +#else + return (NIL); +#endif /* MAIKO_HANDLE_CONSOLE_MESSAGES */ }