- Fixes to HM code for AMOR TOF
- A couple of TAS fixes - o2t was fixed to work with any drivable - FOCUS was mended to include beam monitor in data file
This commit is contained in:
@@ -5,11 +5,17 @@
|
||||
SICS server.
|
||||
|
||||
Mark Koennecke, March 2001
|
||||
|
||||
Use internal connection.
|
||||
Mark Koennecke, July 2002
|
||||
|
||||
*/
|
||||
#include "sics.h"
|
||||
#include "network.h"
|
||||
#include "status.h"
|
||||
#include "synchronize.h"
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Some file statics which hold the connection parameters
|
||||
------------------------------------------------------------------------*/
|
||||
@@ -137,6 +143,7 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
char pBueffel[1024];
|
||||
char pRead[80];
|
||||
int test,i;
|
||||
SConnection *internalCon = NULL;
|
||||
|
||||
/*
|
||||
check for connection
|
||||
@@ -156,6 +163,7 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
/*
|
||||
first tell the remote server to backup
|
||||
*/
|
||||
SetStatusFixed(eBatch);
|
||||
strcpy(pBueffel,"transact backup\n");
|
||||
test = NETWrite(connection,pBueffel,strlen(pBueffel));
|
||||
if(test != 1)
|
||||
@@ -165,6 +173,7 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
connection = NULL;
|
||||
SCWrite(pCon,"ERROR: Failed to contact sync server",eError);
|
||||
SCWrite(pCon,"Try again in order to reconnect before giving up",eWarning);
|
||||
ClearFixedStatus(eEager);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
@@ -182,6 +191,7 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
SCWrite(pCon,"ERROR: Failed to contact sync server",eError);
|
||||
SCWrite(pCon,
|
||||
"Try again in order to reconnect before giving up",eWarning);
|
||||
ClearFixedStatus(eEager);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -208,7 +218,18 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
/*
|
||||
now read the backup file and we are done
|
||||
*/
|
||||
test = InterpExecute(pSics,pCon,"restore");
|
||||
internalCon = SCCreateDummyConnection(pSics);
|
||||
if(internalCon == NULL)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: out of memory in sync",
|
||||
eError);
|
||||
ClearFixedStatus(eEager);
|
||||
return 0;
|
||||
|
||||
}
|
||||
test = InterpExecute(pSics,internalCon,"restore");
|
||||
SCDeleteConnection(internalCon);
|
||||
ClearFixedStatus(eEager);
|
||||
if(test != 1)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: Failed to read sync information",eError);
|
||||
|
||||
Reference in New Issue
Block a user