PSI sics-cvs-psi-2008-10-02

This commit is contained in:
2008-10-02 00:00:00 +00:00
committed by Douglas Clowes
parent 6e926b813f
commit 4baffb9b7a
304 changed files with 77527 additions and 3612 deletions

View File

@@ -236,6 +236,7 @@
int OpenVerifyLogFile()
{
char pFile[256];
char filnam[512];
char *pChar = NULL;
pChar = IFindOption(pSICSOptions,"LogFileBaseName");
@@ -245,10 +246,10 @@
}
else
{
strcpy(pFile,pChar);
strncpy(pFile,pChar,255);
}
sprintf(pFile,"%s%2.2d.log",pFile, iFile);
fLogFile = fopen(pFile,"w");
snprintf(filnam,511,"%s%2.2d.log",pFile, iFile);
fLogFile = fopen(filnam,"w");
if(!fLogFile)
{
fprintf(stderr,"ERROR: Cannot open logfile %s for writing\n",pFile);
@@ -261,6 +262,10 @@
}
}
/*---------------------------------------------------------------------------*/
void SICSLogEnable(int flag) {
iLogUsable=flag;
}
/*---------------------------------------------------------------------------*/
void SICSLogWrite(char *pText, OutCode eOut)
{
@@ -280,6 +285,7 @@
if( (pCurrent->iOut == eOut) || (pCurrent->iAllFlag == 1) )
{
NETWrite(pCurrent->pCon->pSock,pText,strlen(pText));
NETWrite(pCurrent->pCon->pSock,"\n",1);
}
pCurrent = pCurrent->pNext;
}
@@ -316,16 +322,5 @@
fprintf(fLogFile,"%s\n",pText);
fflush(fLogFile);
iLineCount++;
/* do all captured as well */
pCurrent = pCapture;
while(pCurrent)
{
if( (pCurrent->iOut == eOut) || (pCurrent->iAllFlag == 1) )
{
NETWrite(pCurrent->pCon->pSock,pText,strlen(pText));
}
pCurrent = pCurrent->pNext;
}
}
}