Assorted bug fixes

- In network.c and asynnet.c code was added to close the socket when a
  connect failed. Otherwise the socket would leak and the process
  runs out of file descriptors.
- Multicountserc now forcefully handles the counting status. Before I had
  the status flickering between counting and nobeam because the HM has no way to
  diagnose nobeam
- In motorsec.c the pDrivInt->iErrorCount was not reset to 0 properly. Leading to death.
- Removed the stack smashing test flag for the time being.
This commit is contained in:
2014-05-21 09:58:23 +02:00
parent 325fc6f313
commit 4f5bcaeb5e
6 changed files with 16 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#include <counter.h>
#include <stptok.h>
#include <macro.h>
#include <status.h>
#include "sicshipadaba.h"
/*---------------------------------------------------------------------------*/
typedef struct {
@ -313,14 +314,20 @@ static int isMultiMasterRunning(pCounter self, SConnection *pCon, int *status)
UpdateHipadabaPar(stopTime,MakeHdbInt(time(NULL)),pCon);
SecCounterSetError(self,"Master counter errror");
*status = HWBusy;
ClearFixedStatus(eCounting);
break;
case HWPause:
UpdateHipadabaPar(myStatus,MakeHdbText("paused"),pCon);
*status = HWPause;
SetStatusFixed(ePaused);
break;
case HWNoBeam:
UpdateHipadabaPar(myStatus,MakeHdbText("nobeam"),pCon);
*status = HWNoBeam;
SetStatusFixed(eOutOfBeam);
break;
default:
SetStatusFixed(eCounting);
*status = HWBusy;
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
if (self->iCallbackCounter > 20) {
@ -403,6 +410,7 @@ static void multiEndCounting(pCounter self, SConnection *pCon)
InvokeCallBack(self->pCall, COUNTEND, NULL);
ReleaseCountLock(self->pCountInt);
MultiSecTransfer(self,pCon);
ClearFixedStatus(eEager);
}
/*-------------------------------------------------------------------------------------*/
@ -420,11 +428,12 @@ static int MultiSecStatus(void *pData, SConnection * pCon)
}
if(areSlavesRunning(self,pCon, &status)){
SetStatusFixed(eCounting);
return status;
}
multiEndCounting(self,pCon);
return HWIdle;
}
/*---------------------------------------------------------------------------