Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions camshr/RemCamMulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int DoCamMulti(char *routine, char *name, int a, int f, int count,
int serverid = RemoteServerId();
int status = 0;
int writeData;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip data_d = {8, 1, {0}, 0, 0};
struct descrip ans_d = {0, 0, {0}, 0, 0};
Expand Down Expand Up @@ -138,7 +138,7 @@ int RemCamSetMAXBUF(char *name, int new)
{
int serverid = RemoteServerId();
int status = -1;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip ans_d = {0, 0, {0}, 0, 0};
char cmd[512];
Expand All @@ -160,7 +160,7 @@ int RemCamGetMAXBUF(char *name)
{
int serverid = RemoteServerId();
int status = -1;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip ans_d = {0, 0, {0}, 0, 0};
char cmd[512];
Expand Down
10 changes: 5 additions & 5 deletions camshr/RemCamSingle.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ short RemCamLastIosb[4];

int RemoteServerId()
{
static int socket = 0;
if (socket == 0)
static int socket = INVALID_CONNECTION_ID;
if (socket == INVALID_CONNECTION_ID)
{
char *server = getenv("camac_server");
if (server == 0)
Expand All @@ -45,8 +45,8 @@ int RemoteServerId()
else
{
socket = ConnectToMds(server);
if (socket < 0)
socket = 0;
if (socket < INVALID_CONNECTION_ID)
socket = INVALID_CONNECTION_ID;
}
}
return socket;
Expand Down Expand Up @@ -95,7 +95,7 @@ static int CamSingle(char *routine, char *name, int a, int f, void *data,
int serverid = RemoteServerId();
int status = 0;
int writeData;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip data_d = {8, 0, {0}, 0, 0};
struct descrip ans_d = {0, 0, {0}, 0, 0};
Expand Down
6 changes: 3 additions & 3 deletions remcam/CamMulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int DoCamMulti(char *routine, char *name, int a, int f, int count,
int serverid = RemoteServerId();
int status = 0;
int writeData;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip data_d = {8, 1, {0}, 0, 0};
struct descrip ans_d = {0, 0, {0}, 0, 0};
Expand Down Expand Up @@ -137,7 +137,7 @@ EXPORT int CamSetMAXBUF(char *name, int new)
{
int serverid = RemoteServerId();
int status = -1;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip ans_d = {0, 0, {0}, 0, 0};
char cmd[512];
Expand All @@ -159,7 +159,7 @@ EXPORT int CamGetMAXBUF(char *name)
{
int serverid = RemoteServerId();
int status = -1;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip ans_d = {0, 0, {0}, 0, 0};
char cmd[512];
Expand Down
10 changes: 5 additions & 5 deletions remcam/CamSingle.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ short RemCamLastIosb[4];

int RemoteServerId()
{
static int socket = 0;
if (socket == 0)
static int socket = INVALID_CONNECTION_ID;
if (socket == INVALID_CONNECTION_ID)
{
char *server = getenv("camac_server");
if (server == 0)
Expand All @@ -45,8 +45,8 @@ int RemoteServerId()
else
{
socket = ConnectToMds(server);
if (socket < 0)
socket = 0;
if (socket < INVALID_CONNECTION_ID)
socket = INVALID_CONNECTION_ID;
}
}
return socket;
Expand Down Expand Up @@ -96,7 +96,7 @@ static int CamSingle(char *routine, char *name, int a, int f, void *data,
int serverid = RemoteServerId();
int status = 0;
int writeData;
if (serverid)
if (serverid > INVALID_CONNECTION_ID)
{
struct descrip data_d = {8, 0, {0}, 0, 0};
struct descrip ans_d = {0, 0, {0}, 0, 0};
Expand Down