- Currently disabled attempts at logging commands
- Added a warning for excessive data rates on monitors - Added statistics to devser and thus to scriptcontext - Added byte concatenation to dynstring - Added aborting for reflection generation to fourmess.c - Added data checksum testing to hipadaba, use for update tests - Fixed interrupt discovery in network.c, caused invalid interrupt codes which in turn confused sicscron which had to be fixed too. - Renamed ubcalc into ubcalcint in order to reclaim the ubcalc for Jurg - Added an a3offset to tasub in order to fix what I perceive an IS problem - Added support for the newer version of the Siemens SPS, the S7 - Added a not yet fully working sinqhttpopt driver which talks to http HM without libghttp SKIPPED: psi/delcam.c psi/make_gen psi/psi.c psi/sinq.c psi/sinq.h psi/sinqhttpopt.c psi/slsvme.c psi/spss7.c
This commit is contained in:
25
sicscron.c
25
sicscron.c
@ -7,6 +7,8 @@
|
||||
copyright: see copyright.h
|
||||
|
||||
Mark Koennecke, November 1999
|
||||
|
||||
modified to give more error output: Mark Koennecke, December 2010
|
||||
------------------------------------------------------------------------*/
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
@ -16,7 +18,7 @@
|
||||
#include "sics.h"
|
||||
#include "splitter.h"
|
||||
#include "sicscron.h"
|
||||
|
||||
#include "commandlog.h"
|
||||
|
||||
typedef struct {
|
||||
int iInterval;
|
||||
@ -61,6 +63,8 @@ static int CronTask(void *pData)
|
||||
int iRet;
|
||||
Tcl_Interp *pTcl = pServ->pSics->pTcl;
|
||||
time_t now;
|
||||
struct tm *nowtm;
|
||||
char buffer[1024];
|
||||
|
||||
if (!self) {
|
||||
return 0;
|
||||
@ -75,14 +79,16 @@ static int CronTask(void *pData)
|
||||
MacroPop();
|
||||
if (iRet != TCL_OK) {
|
||||
if (strcmp(pTcl->result, "stop") == 0) {
|
||||
SCPrintf(self->pCon, eLogError, "sicscron script '%s' stopped",
|
||||
self->pCommand);
|
||||
snprintf(buffer,1024,"sicscron script '%s' stopped with %s",
|
||||
self->pCommand, pTcl->result);
|
||||
SCPrintf(self->pCon, eLogError, buffer);
|
||||
WriteToCommandLog("SICSCRON:", buffer);
|
||||
self->iEnd = 0;
|
||||
return 0;
|
||||
}
|
||||
SCPrintf(self->pCon, eLogError,
|
||||
"ERROR in sicscron script '%s':", self->pCommand);
|
||||
SCPrintf(self->pCon, eLogError, "ERROR: %s", pTcl->result);
|
||||
snprintf(buffer,1024,"ERROR in sicscron script '%s': %s", self->pCommand, pTcl->result);
|
||||
SCPrintf(self->pCon, eLogError,buffer);
|
||||
WriteToCommandLog("SICSCRON:", buffer);
|
||||
}
|
||||
if (self->iEnd == 2) { /* dolater command */
|
||||
self->iEnd = 0;
|
||||
@ -92,6 +98,11 @@ static int CronTask(void *pData)
|
||||
if (now > self->tNext)
|
||||
self->tNext = now + 1;
|
||||
}
|
||||
/* printf("CronTask return: %d\n", self->iEnd > 0);*/
|
||||
if(self->iEnd <= 0){
|
||||
snprintf(buffer,1024,"crontask terminating at %s on %d", ctime(&now), self->iEnd);
|
||||
WriteToCommandLog("SICSCRON", buffer);
|
||||
}
|
||||
return self->iEnd > 0;
|
||||
}
|
||||
|
||||
@ -106,7 +117,7 @@ static void CronSignal(void *pData, int iID, void *pSigData)
|
||||
|
||||
if (iID == SICSINT) {
|
||||
iInt = (int *) pSigData;
|
||||
if (*iInt >= eEndServer) {
|
||||
if (*iInt == eEndServer) {
|
||||
self->iEnd = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user