- Various fixes to make mountaingum work
This commit is contained in:
16
exeman.c
16
exeman.c
@ -316,7 +316,7 @@ static int SCHdbWrite(SConnection *self, char *message, int outCode){
|
|||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
int exeHdbNode(pHdb exeNode, SConnection *pCon){
|
int exeHdbNode(pHdb exeNode, SConnection *pCon){
|
||||||
char pBueffel[512], *name = NULL;
|
char pBueffel[512], *name = NULL;
|
||||||
pHdb node = NULL;
|
pHdb node = NULL, log = NULL;
|
||||||
pExeBuf buffer = NULL;
|
pExeBuf buffer = NULL;
|
||||||
hdbValue v;
|
hdbValue v;
|
||||||
int status;
|
int status;
|
||||||
@ -326,17 +326,17 @@ int exeHdbNode(pHdb exeNode, SConnection *pCon){
|
|||||||
/*
|
/*
|
||||||
* clear log buffer
|
* clear log buffer
|
||||||
*/
|
*/
|
||||||
node = GetHipadabaNode(exeNode,"log");
|
log = GetHipadabaNode(exeNode,"log");
|
||||||
if(node == NULL){
|
if(log == NULL){
|
||||||
SCWrite(pCon,"ERROR: Hdb node not found or in wrong format",eError);
|
SCWrite(pCon,"ERROR: Hdb node not found or in wrong format",eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
v = MakeHdbText(strdup(""));
|
v = MakeHdbText(strdup(""));
|
||||||
UpdateHipadabaPar(node,v,pCon);
|
UpdateHipadabaPar(log,v,pCon);
|
||||||
/*
|
/*
|
||||||
* prepare context
|
* prepare context
|
||||||
*/
|
*/
|
||||||
name = GetHipadabaPath(node);
|
name = GetHipadabaPath(log);
|
||||||
cc = SCGetContext(pCon);
|
cc = SCGetContext(pCon);
|
||||||
strncpy(cc.deviceID, name,255);
|
strncpy(cc.deviceID, name,255);
|
||||||
strncpy(bufferNode,name,511);
|
strncpy(bufferNode,name,511);
|
||||||
@ -371,6 +371,12 @@ int exeHdbNode(pHdb exeNode, SConnection *pCon){
|
|||||||
status = exeBufProcess(buffer,pServ->pSics,pCon,NULL,0);
|
status = exeBufProcess(buffer,pServ->pSics,pCon,NULL,0);
|
||||||
SCSetWriteFunc(pCon,oldWrite);
|
SCSetWriteFunc(pCon,oldWrite);
|
||||||
SCPopContext(pCon);
|
SCPopContext(pCon);
|
||||||
|
exeBufDelete(buffer);
|
||||||
|
if(strlen(log->value.v.text) < 2){
|
||||||
|
v = MakeHdbText(strdup("OK\n"));
|
||||||
|
UpdateHipadabaPar(log,v,pCon);
|
||||||
|
ReleaseHdbValue(&v);
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
82
hdbqueue.c
82
hdbqueue.c
@ -18,6 +18,7 @@
|
|||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int iStop;
|
int iStop;
|
||||||
|
int isRunning;
|
||||||
SConnection *pCon;
|
SConnection *pCon;
|
||||||
}HdbQueue, *pHdbQueue;
|
}HdbQueue, *pHdbQueue;
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@ -155,7 +156,7 @@ static void sequentialNames(pHdb obj,SConnection *pCon){
|
|||||||
current = work->child;
|
current = work->child;
|
||||||
while(current != NULL){
|
while(current != NULL){
|
||||||
snprintf(name,80,"%3.3d",count);
|
snprintf(name,80,"%3.3d",count);
|
||||||
if(current != NULL && current->name != NULL){
|
if(current->name != NULL){
|
||||||
free(current->name);
|
free(current->name);
|
||||||
}
|
}
|
||||||
current->name = strdup(name);
|
current->name = strdup(name);
|
||||||
@ -173,7 +174,14 @@ static void sequentialNames(pHdb obj,SConnection *pCon){
|
|||||||
static int Dequeue(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
static int Dequeue(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
||||||
pHdb work = NULL;
|
pHdb work = NULL;
|
||||||
char name[80];
|
char name[80];
|
||||||
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
|
||||||
|
if(priv->isRunning == 1){
|
||||||
|
SCWrite(pCon,"ERROR: cannot dequeue while running",eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(nPar < 1){
|
if(nPar < 1){
|
||||||
SCWrite(pCon,"ERROR: internal: not enough parameters to Dequeue",eError);
|
SCWrite(pCon,"ERROR: internal: not enough parameters to Dequeue",eError);
|
||||||
return 0;
|
return 0;
|
||||||
@ -193,8 +201,13 @@ static int Dequeue(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
|||||||
static int Clean(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
static int Clean(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
||||||
int i;
|
int i;
|
||||||
pHdb current = NULL, queue = NULL;
|
pHdb current = NULL, queue = NULL;
|
||||||
pHdb currentEntry = NULL, tmp;
|
pHdb currentEntry = NULL, tmp = NULL;
|
||||||
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
|
||||||
|
if(priv->isRunning == 1){
|
||||||
|
SCWrite(pCon,"ERROR: cannot clean while running",eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
currentEntry = GetHipadabaNode(self->objectNode,"control/currentEntry");
|
currentEntry = GetHipadabaNode(self->objectNode,"control/currentEntry");
|
||||||
queue = GetHipadabaNode(self->objectNode,"queue");
|
queue = GetHipadabaNode(self->objectNode,"queue");
|
||||||
current = queue->child;
|
current = queue->child;
|
||||||
@ -211,6 +224,31 @@ static int Clean(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
|||||||
NotifyHipadabaPar(currentEntry,pCon);
|
NotifyHipadabaPar(currentEntry,pCon);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
static int CleanAll(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
||||||
|
int i;
|
||||||
|
pHdb current = NULL, queue = NULL;
|
||||||
|
pHdb currentEntry = NULL, tmp;
|
||||||
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
|
||||||
|
if(priv->isRunning == 1){
|
||||||
|
SCWrite(pCon,"ERROR: cannot clear queue while executing",eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
currentEntry = GetHipadabaNode(self->objectNode,"control/currentEntry");
|
||||||
|
queue = GetHipadabaNode(self->objectNode,"queue");
|
||||||
|
current = queue->child;
|
||||||
|
while(current != NULL){
|
||||||
|
tmp = current->next;
|
||||||
|
DeleteNodeData(current);
|
||||||
|
current = tmp;
|
||||||
|
}
|
||||||
|
queue->child = NULL;
|
||||||
|
currentEntry->value.v.intValue = 0;
|
||||||
|
sequentialNames(self->objectNode, pCon);
|
||||||
|
NotifyHipadabaPar(currentEntry,pCon);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
static int QueueTask(void *pData){
|
static int QueueTask(void *pData){
|
||||||
pSICSOBJ self = (pSICSOBJ)pData;
|
pSICSOBJ self = (pSICSOBJ)pData;
|
||||||
@ -222,6 +260,7 @@ static int QueueTask(void *pData){
|
|||||||
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
|
||||||
if(priv->iStop == 1){
|
if(priv->iStop == 1){
|
||||||
|
priv->isRunning = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,6 +277,7 @@ static int QueueTask(void *pData){
|
|||||||
MacroPop();
|
MacroPop();
|
||||||
}
|
}
|
||||||
if(priv->iStop == 1 || SCGetInterrupt(priv->pCon) != eContinue){
|
if(priv->iStop == 1 || SCGetInterrupt(priv->pCon) != eContinue){
|
||||||
|
priv->isRunning = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,6 +285,7 @@ static int QueueTask(void *pData){
|
|||||||
work->value.v.intValue = pos;
|
work->value.v.intValue = pos;
|
||||||
NotifyHipadabaPar(work,priv->pCon);
|
NotifyHipadabaPar(work,priv->pCon);
|
||||||
if(pos >= max->value.v.intValue){
|
if(pos >= max->value.v.intValue){
|
||||||
|
priv->isRunning = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,6 +297,12 @@ static int Start(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
|||||||
|
|
||||||
priv->iStop = 0;
|
priv->iStop = 0;
|
||||||
priv->pCon = pCon;
|
priv->pCon = pCon;
|
||||||
|
|
||||||
|
if(priv->isRunning == 1){
|
||||||
|
SCWrite(pCon,"ERROR: Hdbqueue is already running",eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
priv->isRunning = 1;
|
||||||
|
|
||||||
TaskRegister(pServ->pTasker,
|
TaskRegister(pServ->pTasker,
|
||||||
QueueTask,
|
QueueTask,
|
||||||
@ -266,6 +313,19 @@ static int Start(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
static int Restart(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
||||||
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
pHdb maxCurrent = NULL;
|
||||||
|
|
||||||
|
maxCurrent = GetHipadabaNode(self->objectNode,"control/currentEntry");
|
||||||
|
if(maxCurrent != NULL){
|
||||||
|
maxCurrent->value.v.intValue = 0;
|
||||||
|
NotifyHipadabaPar(maxCurrent,pCon);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Start(self,pCon,par,nPar);
|
||||||
|
}
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
static int Stop(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
static int Stop(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
||||||
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
|
||||||
@ -279,6 +339,12 @@ static int Move(pSICSOBJ self, SConnection *pCon, pHdb par[], int nPar){
|
|||||||
pHdb prevNode = NULL, queueNode = NULL;
|
pHdb prevNode = NULL, queueNode = NULL;
|
||||||
pHdb tmp;
|
pHdb tmp;
|
||||||
char name[80];
|
char name[80];
|
||||||
|
pHdbQueue priv = (pHdbQueue)self->pPrivate;
|
||||||
|
|
||||||
|
if(priv->isRunning == 1){
|
||||||
|
SCWrite(pCon,"ERROR: cannot move while running",eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(nPar < 2){
|
if(nPar < 2){
|
||||||
SCWrite(pCon,"ERROR: internal: not enough parameters to Move",eError);
|
SCWrite(pCon,"ERROR: internal: not enough parameters to Move",eError);
|
||||||
@ -375,11 +441,21 @@ static void Configure(pSICSOBJ self){
|
|||||||
AddHipadabaChild(obj,n,NULL);
|
AddHipadabaChild(obj,n,NULL);
|
||||||
AppendHipadabaCallback(n,HCBSET,MakeSICSFuncCallback(self));
|
AppendHipadabaCallback(n,HCBSET,MakeSICSFuncCallback(self));
|
||||||
|
|
||||||
|
funcValue = makeHdbData(HIPFUNC,1,CleanAll);
|
||||||
|
n = MakeSICSHdbPar("cleanall",usUser, funcValue);
|
||||||
|
AddHipadabaChild(obj,n,NULL);
|
||||||
|
AppendHipadabaCallback(n,HCBSET,MakeSICSFuncCallback(self));
|
||||||
|
|
||||||
funcValue = makeHdbData(HIPFUNC,1,Start);
|
funcValue = makeHdbData(HIPFUNC,1,Start);
|
||||||
n = MakeSICSHdbPar("start",usUser, funcValue);
|
n = MakeSICSHdbPar("start",usUser, funcValue);
|
||||||
AddHipadabaChild(obj,n,NULL);
|
AddHipadabaChild(obj,n,NULL);
|
||||||
AppendHipadabaCallback(n,HCBSET,MakeSICSFuncCallback(self));
|
AppendHipadabaCallback(n,HCBSET,MakeSICSFuncCallback(self));
|
||||||
|
|
||||||
|
funcValue = makeHdbData(HIPFUNC,1,Restart);
|
||||||
|
n = MakeSICSHdbPar("restart",usUser, funcValue);
|
||||||
|
AddHipadabaChild(obj,n,NULL);
|
||||||
|
AppendHipadabaCallback(n,HCBSET,MakeSICSFuncCallback(self));
|
||||||
|
|
||||||
funcValue = makeHdbData(HIPFUNC,1,Stop);
|
funcValue = makeHdbData(HIPFUNC,1,Stop);
|
||||||
n = MakeSICSHdbPar("stop",usUser, funcValue);
|
n = MakeSICSHdbPar("stop",usUser, funcValue);
|
||||||
AddHipadabaChild(obj,n,NULL);
|
AddHipadabaChild(obj,n,NULL);
|
||||||
|
@ -457,6 +457,9 @@ int compareHdbValue(hdbValue v1, hdbValue v2){
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HIPTEXT:
|
case HIPTEXT:
|
||||||
|
if(v1.v.text == NULL || v2.v.text == NULL){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if(strcmp(v1.v.text,v2.v.text) == 0){
|
if(strcmp(v1.v.text,v2.v.text) == 0){
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -178,6 +178,7 @@ static int insertMonitor(pMcStasReader self, SConnection *pCon,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(pBueffel,0,512);
|
||||||
status = NXgetdata(self->handle,pBueffel);
|
status = NXgetdata(self->handle,pBueffel);
|
||||||
if(status != NX_OK){
|
if(status != NX_OK){
|
||||||
snprintf(pBueffel,511,"ERROR: Nexus error %s while reading %s",
|
snprintf(pBueffel,511,"ERROR: Nexus error %s while reading %s",
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <time.h>
|
||||||
#include "sics.h"
|
#include "sics.h"
|
||||||
#include "countdriv.h"
|
#include "countdriv.h"
|
||||||
#include "mccontrol.h"
|
#include "mccontrol.h"
|
||||||
@ -76,6 +77,7 @@ static int McReadValues(struct __COUNTER *self){
|
|||||||
if(status == HWFault){
|
if(status == HWFault){
|
||||||
self->iErrorCode = SCRIPTERROR;
|
self->iErrorCode = SCRIPTERROR;
|
||||||
}
|
}
|
||||||
|
self->fTime = time(NULL) - pMcStas->startTime;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
@ -236,6 +236,7 @@
|
|||||||
int OpenVerifyLogFile()
|
int OpenVerifyLogFile()
|
||||||
{
|
{
|
||||||
char pFile[256];
|
char pFile[256];
|
||||||
|
char filnam[512];
|
||||||
char *pChar = NULL;
|
char *pChar = NULL;
|
||||||
|
|
||||||
pChar = IFindOption(pSICSOptions,"LogFileBaseName");
|
pChar = IFindOption(pSICSOptions,"LogFileBaseName");
|
||||||
@ -245,10 +246,10 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy(pFile,pChar);
|
strncpy(pFile,pChar,255);
|
||||||
}
|
}
|
||||||
sprintf(pFile,"%s%2.2d.log",pFile, iFile);
|
snprintf(filnam,511,"%s%2.2d.log",pFile, iFile);
|
||||||
fLogFile = fopen(pFile,"w");
|
fLogFile = fopen(filnam,"w");
|
||||||
if(!fLogFile)
|
if(!fLogFile)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"ERROR: Cannot open logfile %s for writing\n",pFile);
|
fprintf(stderr,"ERROR: Cannot open logfile %s for writing\n",pFile);
|
||||||
|
@ -456,7 +456,7 @@ static void updateCountList(){
|
|||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static int CounterCallback(int iEvent, void *eventData, void *userData,
|
static int CounterCallback(int iEvent, void *eventData, void *userData,
|
||||||
commandContext cc){
|
commandContext cc){
|
||||||
if(iEvent == MONITOR || iEvent == COUNTEND || iEvent == COUNTSTART){
|
if(iEvent == MONITOR || iEvent == COUNTEND){
|
||||||
updateCountList();
|
updateCountList();
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -336,6 +336,7 @@ static int SICSNotifyCallback(void *userData, void *callData, pHdb node,
|
|||||||
SCPopContext(cbInfo->pCon);
|
SCPopContext(cbInfo->pCon);
|
||||||
SCsetMacro(cbInfo->pCon,macro);
|
SCsetMacro(cbInfo->pCon,macro);
|
||||||
free(pPath);
|
free(pPath);
|
||||||
|
DeleteDynString(result);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -472,7 +473,7 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node,
|
|||||||
command = (char *)userData;
|
command = (char *)userData;
|
||||||
pCon = (SConnection *)callData;
|
pCon = (SConnection *)callData;
|
||||||
|
|
||||||
assert(command != NULL && pCon != NULL);
|
assert(command != NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* evaluate
|
* evaluate
|
||||||
@ -481,7 +482,9 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node,
|
|||||||
if(status != TCL_OK){
|
if(status != TCL_OK){
|
||||||
snprintf(error,1023,"ERROR: Tcl returned error: %s",
|
snprintf(error,1023,"ERROR: Tcl returned error: %s",
|
||||||
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
||||||
SCWrite(pCon,error,eError);
|
if(pCon != NULL){
|
||||||
|
SCWrite(pCon,error,eError);
|
||||||
|
}
|
||||||
status = 0;
|
status = 0;
|
||||||
} else {
|
} else {
|
||||||
status = 1;
|
status = 1;
|
||||||
@ -494,7 +497,9 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node,
|
|||||||
*/
|
*/
|
||||||
data = (char *)Tcl_GetStringResult(InterpGetTcl(pServ->pSics));
|
data = (char *)Tcl_GetStringResult(InterpGetTcl(pServ->pSics));
|
||||||
if(data == NULL){
|
if(data == NULL){
|
||||||
SCWrite(pCon,"ERROR: no result returned from script",eError);
|
if(pCon != NULL){
|
||||||
|
SCWrite(pCon,"ERROR: no result returned from script",eError);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
equal = strchr(data,'=');
|
equal = strchr(data,'=');
|
||||||
@ -504,7 +509,9 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node,
|
|||||||
strcpy(error,"ERROR: ");
|
strcpy(error,"ERROR: ");
|
||||||
status = readHdbValue(&node->value,data, error+7, 1024-7);
|
status = readHdbValue(&node->value,data, error+7, 1024-7);
|
||||||
if(status != 1){
|
if(status != 1){
|
||||||
SCWrite(pCon,error,eError);
|
if(pCon != NULL){
|
||||||
|
SCWrite(pCon,error,eError);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
@ -2353,12 +2360,10 @@ static int ChainCallback(void *userData, void *callData, pHdb node,
|
|||||||
hdbValue vv, old;
|
hdbValue vv, old;
|
||||||
|
|
||||||
if(slave != NULL){
|
if(slave != NULL){
|
||||||
old = slave->value;
|
|
||||||
memset(&vv,0,sizeof(hdbValue));
|
memset(&vv,0,sizeof(hdbValue));
|
||||||
GetHipadabaPar(slave,&vv,callData);
|
GetHipadabaPar(slave,&vv,callData);
|
||||||
if(!compareHdbValue(old,vv)){
|
UpdateHipadabaPar(slave, vv, callData);
|
||||||
UpdateHipadabaPar(slave, vv, callData);
|
ReleaseHdbValue(&vv);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
35
statemon.c
35
statemon.c
@ -132,24 +132,26 @@ static pHdb recurseInterestNode(pHdb current, char *pDevice){
|
|||||||
*/
|
*/
|
||||||
alias = FindAliases(pServ->pSics,pSicsdev);
|
alias = FindAliases(pServ->pSics,pSicsdev);
|
||||||
pPtr = alias;
|
pPtr = alias;
|
||||||
while((pPtr = stptok(pPtr,pAlias,131,",")) != NULL){
|
if(pPtr != NULL){
|
||||||
if(strcmp(pAlias,pDevice) == 0){
|
while((pPtr = stptok(pPtr,pAlias,131,",")) != NULL){
|
||||||
return current;
|
if(strcmp(pAlias,pDevice) == 0){
|
||||||
}
|
return current;
|
||||||
}
|
}
|
||||||
if(alias != NULL){
|
}
|
||||||
free(alias);
|
if(alias != NULL){
|
||||||
}
|
free(alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
current = current->child;
|
current = current->child;
|
||||||
while(current != NULL){
|
while(current != NULL){
|
||||||
result = recurseInterestNode(current, pDevice);
|
result = recurseInterestNode(current, pDevice);
|
||||||
if(result != NULL){
|
if(result != NULL){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
current = current->next;
|
current = current->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@ -192,6 +194,9 @@ static int StateHdbInterest(int iEvent, void *pEvent, void *pUser,
|
|||||||
snprintf(buffer,1024,"%s FINISH", path);
|
snprintf(buffer,1024,"%s FINISH", path);
|
||||||
SCWriteInContext(pCon,buffer,eWarning,cc);
|
SCWriteInContext(pCon,buffer,eWarning,cc);
|
||||||
}
|
}
|
||||||
|
if(path != NULL){
|
||||||
|
free(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user