From eb1be8aef94164303e5a4f3c60261d50b2642270 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Thu, 30 Sep 2004 17:29:32 +0000 Subject: [PATCH] Set logfile to NULL on close. --- src/sbbs3/websrvr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c index cb8071f0eb..fd7601cb9d 100644 --- a/src/sbbs3/websrvr.c +++ b/src/sbbs3/websrvr.c @@ -2700,8 +2700,10 @@ void http_logging_thread(void* arg) SAFECOPY(newfilename,base); strftime(strchr(newfilename,0),15,"%G-%m-%d.log",&ld->completed); if(strcmp(newfilename,filename)) { - if(logfile!=NULL) + if(logfile!=NULL) { fclose(logfile); + logfile=NULL; + } SAFECOPY(filename,newfilename); logfile=fopen(filename,"ab"); lprintf(LOG_INFO,"http logfile is now: %s",filename); @@ -2737,8 +2739,10 @@ void http_logging_thread(void* arg) lprintf(LOG_ERR,"logfile %s was not open!",filename); } } - if(logfile!=NULL) + if(logfile!=NULL) { fclose(logfile); + logfile=NULL; + } thread_down(); } -- GitLab