From 8e5064aaf5db806248136dc4afabaf4eda6cd0ef Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Thu, 1 Nov 2001 13:08:04 +0000 Subject: [PATCH] outchar no longer tries to output to socket if socket is not open. --- xtrn/sdk/xsdk.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/xtrn/sdk/xsdk.c b/xtrn/sdk/xsdk.c index 8efa2c9273..4b7b3ec3de 100644 --- a/xtrn/sdk/xsdk.c +++ b/xtrn/sdk/xsdk.c @@ -379,17 +379,18 @@ void outchar(char ch) { #ifndef __16BIT__ - ulong top=outbuftop+1; - - if(top==sizeof(outbuf)) - top=0; - if(top!=outbufbot) { - outbuf[outbuftop++]=ch; - if(outbuftop==sizeof(outbuf)) - outbuftop=0; - sem_post(&output_sem); + if(client_socket!=INVALID_SOCKET) { + ulong top=outbuftop+1; + + if(top==sizeof(outbuf)) + top=0; + if(top!=outbufbot) { + outbuf[outbuftop++]=ch; + if(outbuftop==sizeof(outbuf)) + outbuftop=0; + sem_post(&output_sem); + } } - #endif if(con_fp!=NULL) -- GitLab