Cleaned up ANSTO code to merge with sinqdev.sics
This is our new RELEASE-4_0 branch which was taken from ansto/93d9a7c Conflicts: .gitignore SICSmain.c asynnet.c confvirtualmot.c counter.c devexec.c drive.c event.h exebuf.c exeman.c histmem.c interface.h motor.c motorlist.c motorsec.c multicounter.c napi.c napi.h napi4.c network.c nwatch.c nxscript.c nxxml.c nxxml.h ofac.c reflist.c scan.c sicshipadaba.c sicsobj.c site_ansto/docs/Copyright.txt site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl statusfile.c tasdrive.c tasub.c tasub.h tasublib.c tasublib.h
This commit is contained in:
12
network.c
12
network.c
@ -67,7 +67,7 @@ struct timeval lastclose = { -1, 0 };
|
||||
/*-----------------------------------------------------------------------
|
||||
Redefine this function if another means of error reporting is necessary.
|
||||
*/
|
||||
static void NetError(char *pText)
|
||||
static void NetError(const char pText[])
|
||||
{
|
||||
/*
|
||||
SICSLogWrite(pText,eError);
|
||||
@ -287,8 +287,9 @@ mkChannel *NETConnectWithFlags(char *name, int port, int flags)
|
||||
|
||||
iRet = connect(pRes->sockid, (struct sockaddr *) &(pRes->adresse),
|
||||
sizeof(struct sockaddr_in));
|
||||
if (iRet < 0) {
|
||||
if (iRet < 0 && errno ) {
|
||||
if (errno != EINPROGRESS) {
|
||||
close(pRes->sockid);
|
||||
free(pRes);
|
||||
return NULL;
|
||||
}
|
||||
@ -607,7 +608,7 @@ int NETReadTillTerm(mkChannel * self, long timeout,
|
||||
gettimeofday(&start, NULL);
|
||||
|
||||
if (pTerm == NULL)
|
||||
pTerm = "";
|
||||
pTerm = strdup("");
|
||||
|
||||
length = strlen(pTerm);
|
||||
memset(pBuffer, 0, iBufLen);
|
||||
@ -848,8 +849,9 @@ mkChannel *UDPOpen(int iPort)
|
||||
i = 1;
|
||||
setsockopt(pRes->sockid, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(int));
|
||||
|
||||
assert(pRes->sockid < FD_SETSIZE);
|
||||
/* if this fails the masks for select will be to
|
||||
/*
|
||||
assert(pRes->sockid < (sizeof(long) * 8));
|
||||
if this fails the masks for select will be to
|
||||
short.
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user