Skip to content
Snippets Groups Projects
Commit 1cdc4d8d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix-up the recently-added debug/error log messages

I didn't look closely enough at which write() call I was instrumenting.
This is now more useful, though I think we already found the root-cause
based on different log output ("Unexpected ansi_getxy response").
parent 1f04cc14
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -775,6 +775,7 @@ void sbbs_t::privchat(bool forced, int node_num) ...@@ -775,6 +775,7 @@ void sbbs_t::privchat(bool forced, int node_num)
char outpath[MAX_PATH+1]; char outpath[MAX_PATH+1];
char inpath[MAX_PATH+1]; char inpath[MAX_PATH+1];
uchar ch; uchar ch;
int wr;
int in,out,i,n,echo=1,x,y,activity,remote_activity; int in,out,i,n,echo=1,x,y,activity,remote_activity;
int local_y=1,remote_y=1; int local_y=1,remote_y=1;
node_t node; node_t node;
...@@ -1071,15 +1072,22 @@ void sbbs_t::privchat(bool forced, int node_num) ...@@ -1071,15 +1072,22 @@ void sbbs_t::privchat(bool forced, int node_num)
(void)read(out,&c,1); (void)read(out,&c,1);
(void)lseek(out,-1L,SEEK_CUR); (void)lseek(out,-1L,SEEK_CUR);
if(!c) /* hasn't wrapped */ if(!c) /* hasn't wrapped */
write(out,&ch,1); wr = write(out,&ch,1);
else { else {
if(!tell(out)) if(!tell(out))
lseek(out,0L,SEEK_END); lseek(out,0L,SEEK_END);
lseek(out,-1L,SEEK_CUR); lseek(out,-1L,SEEK_CUR);
ch=0; ch=0;
write(out,&ch,1); wr = write(out,&ch,1);
lseek(out,-1L,SEEK_CUR); lseek(out,-1L,SEEK_CUR);
} }
if(wr != 1)
lprintf(LOG_ERR, "write of character 0x%02X to %s returned %d", ch, outpath, wr);
else if(ch < ' ')
lprintf(LOG_DEBUG, "wrote control character %u (%s) to %s", ch, c_escape_char(ch), outpath);
else
lprintf(LOG_DEBUG, "wrote character '%c' to %s", ch, outpath);
utime(outpath,NULL); /* update mod time for NFS/smbfs nodes */ utime(outpath,NULL); /* update mod time for NFS/smbfs nodes */
if(tell(out)>=PCHAT_LEN) if(tell(out)>=PCHAT_LEN)
lseek(out,0L,SEEK_SET); lseek(out,0L,SEEK_SET);
...@@ -1169,13 +1177,8 @@ void sbbs_t::privchat(bool forced, int node_num) ...@@ -1169,13 +1177,8 @@ void sbbs_t::privchat(bool forced, int node_num)
} }
} }
ch=0; ch=0;
int wr = write(in,&ch,1); if(write(in,&ch,1) != 1)
if(wr != 1) lprintf(LOG_ERR, "write of NUL to %s returned %d", inpath, wr);
lprintf(LOG_ERR, "write of character 0x%02X to %s returned %d", ch, inpath, wr);
else if(ch < ' ')
lprintf(LOG_DEBUG, "wrote control character %u (%s) to %s", ch, c_escape_char(ch), inpath);
else
lprintf(LOG_DEBUG, "wrote character '%c' to %s", ch, inpath);
if(!(sys_status&SS_SPLITP)) if(!(sys_status&SS_SPLITP))
localchar=remotechar; localchar=remotechar;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment