- flush autologfile faster
This commit is contained in:
@ -34,6 +34,8 @@
|
||||
/*-------------------- the tail buffer ---------------------------------*/
|
||||
static pCircular pTail = NULL;
|
||||
#define MAXTAIL 1000
|
||||
/*----------------------------------------------------------------------*/
|
||||
static time_t tLastWrite = 0;
|
||||
/*----------------------------------------------------------------------*/
|
||||
void WriteToCommandLog(char *prompt,char *text)
|
||||
{
|
||||
@ -113,6 +115,7 @@
|
||||
/* automatic file */
|
||||
if(fauto != NULL)
|
||||
{
|
||||
time(&tLastWrite);
|
||||
if(iNL)
|
||||
{
|
||||
fprintf(fauto,"%s %s",prompt, pText);
|
||||
@ -316,6 +319,11 @@
|
||||
fflush(fauto);
|
||||
}
|
||||
|
||||
if (fauto && tLastWrite != 0 && tNow > tLastWrite) {
|
||||
fflush(fauto);
|
||||
tLastWrite = 0;
|
||||
}
|
||||
|
||||
return iEnd;
|
||||
}
|
||||
/*----------- a command to configure the log --------------------------*/
|
||||
|
Reference in New Issue
Block a user