- flush autologfile faster

This commit is contained in:
zolliker
2007-09-25 06:56:06 +00:00
parent 460921f324
commit 660f0c8b54

View File

@ -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 --------------------------*/