diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index 5b393008e..68469f70b 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -432,9 +432,9 @@ void cac::beaconNotify ( const inetAddrID &addr ) * from replying at once. */ { - struct sockaddr_in saddr; - int saddr_length = sizeof(saddr); - int status; + struct sockaddr_in saddr; + osiSocklen_t saddr_length = sizeof ( saddr ); + int status; status = getsockname ( this->pudpiiu->getSock (), (struct sockaddr *) &saddr, &saddr_length ); if ( status < 0 ) { diff --git a/src/ca/recvProcessThread.cpp b/src/ca/recvProcessThread.cpp index 43eb16032..3865fe90a 100644 --- a/src/ca/recvProcessThread.cpp +++ b/src/ca/recvProcessThread.cpp @@ -116,4 +116,4 @@ void recvProcessThread::disable () void recvProcessThread::signalActivity () { this->recvActivity.signal (); -} \ No newline at end of file +} diff --git a/src/ca/repeater.cpp b/src/ca/repeater.cpp index 71ea48bcf..cdac390e7 100644 --- a/src/ca/repeater.cpp +++ b/src/ca/repeater.cpp @@ -476,7 +476,6 @@ void epicsShareAPI ca_repeater () int size; SOCKET sock; osiSockAddr from; - int from_size = sizeof ( from ); unsigned short port; makeSocketReturn msr; @@ -504,8 +503,7 @@ void epicsShareAPI ca_repeater () debugPrintf ( ( "CA Repeater: Attached and initialized\n" ) ); while ( true ) { - caHdr *pMsg; - + osiSocklen_t from_size = sizeof ( from ); size = recvfrom ( sock, buf, sizeof (buf), 0, &from.sa, &from_size ); if ( size < 0 ) { @@ -524,7 +522,7 @@ void epicsShareAPI ca_repeater () continue; } - pMsg = (caHdr *) buf; + caHdr *pMsg = (caHdr *) buf; /* * both zero length message and a registration message diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index df191f84f..0d8e39ce5 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -57,9 +57,9 @@ const udpiiu::pProtoStubUDP udpiiu::udpJumpTableCAC[] = // void udpiiu::recvMsg () { - osiSockAddr src; - int src_size = sizeof (src); - int status; + osiSockAddr src; + osiSocklen_t src_size = sizeof (src); + int status; status = recvfrom ( this->sock, this->recvBuf, sizeof ( this->recvBuf ), 0, &src.sa, &src_size ); @@ -456,7 +456,7 @@ void udpiiu::shutdown () if ( laborRequired ) { int status; osiSockAddr addr; - int size = sizeof ( addr.sa ); + osiSocklen_t size = sizeof ( addr.sa ); status = getsockname ( this->sock, &addr.sa, &size ); if ( status < 0 ) { diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 94a70ebc1..ddf3152f5 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -139,7 +139,7 @@ struct client *create_client (SOCKET sock) int status; struct client *client; int true = TRUE; - int addrSize; + osiSocklen_t addrSize; unsigned priorityOfEvents; /* @@ -343,7 +343,7 @@ LOCAL int req_server (void) while (TRUE) { struct sockaddr sockAddr; - int addLen = sizeof(sockAddr); + osiSocklen_t addLen = sizeof(sockAddr); if ( ( clientSock = accept ( IOC_sock, &sockAddr, &addLen ) ) == INVALID_SOCKET ) { errlogPrintf("CAS: Client accept error was \"%s\"\n", diff --git a/src/rsrv/cast_server.c b/src/rsrv/cast_server.c index f12d3db07..05124978f 100644 --- a/src/rsrv/cast_server.c +++ b/src/rsrv/cast_server.c @@ -127,7 +127,7 @@ int cast_server(void) int status; int count=0; struct sockaddr_in new_recv_addr; - int recv_addr_size; + osiSocklen_t recv_addr_size; unsigned short port; int nchars; threadId tid; diff --git a/src/rsrv/online_notify.c b/src/rsrv/online_notify.c index 2554e8197..8a2b72fe5 100644 --- a/src/rsrv/online_notify.c +++ b/src/rsrv/online_notify.c @@ -156,7 +156,7 @@ int rsrv_online_notify_task() else { struct sockaddr_in if_addr; - int size = sizeof (if_addr); + osiSocklen_t size = sizeof (if_addr); status = getsockname (sock, (struct sockaddr *) &if_addr, &size); if (status<0) { errlogPrintf ( "%s: CA beacon routing (getsockname) error was \"%s\"\n", diff --git a/src/util/iocLogServer.c b/src/util/iocLogServer.c index f5a51f965..b94dc141d 100644 --- a/src/util/iocLogServer.c +++ b/src/util/iocLogServer.c @@ -47,6 +47,9 @@ * .09 050494 pg HPUX port changes. * .10 021694 joh ANSI C * $Log$ + * Revision 1.37 2000/02/10 17:47:13 jhill + * dont include osiSockResource.h + * * Revision 1.36 2000/02/04 15:52:33 mrk * bsdSocketResource=>osiSockResource * @@ -511,36 +514,35 @@ static void handleLogFileError(void) * acceptNewClient() * */ -static void acceptNewClient(void *pParam) +static void acceptNewClient ( void *pParam ) { - struct ioc_log_server *pserver = (struct ioc_log_server *)pParam; + struct ioc_log_server *pserver = (struct ioc_log_server *) pParam; struct iocLogClient *pclient; - int size; - struct sockaddr_in addr; - int status; - osiSockIoctl_t optval; + osiSocklen_t addrSize; + struct sockaddr_in addr; + int status; + osiSockIoctl_t optval; - pclient = (struct iocLogClient *) - malloc(sizeof *pclient); - if(!pclient){ + pclient = ( struct iocLogClient * ) malloc ( sizeof ( *pclient ) ); + if ( ! pclient ) { return; } - size = sizeof(addr); - pclient->insock = accept(pserver->sock, (struct sockaddr *)&addr, &size); - if (pclient->insock<0 || sizeinsock = accept ( pserver->sock, (struct sockaddr *)&addr, &addrSize ); + if ( pclient->insock<0 || addrSize < sizeof (addr) ) { static unsigned acceptErrCount; static int lastErrno; int thisErrno; - free(pclient); - if (SOCKERRNO==SOCK_EWOULDBLOCK || SOCKERRNO==SOCK_EINTR) { + free ( pclient ); + if ( SOCKERRNO == SOCK_EWOULDBLOCK || SOCKERRNO == SOCK_EINTR ) { return; } thisErrno = SOCKERRNO; - if (acceptErrCount%1000 || lastErrno!=thisErrno) { - fprintf(stderr, "Accept Error %d\n", SOCKERRNO); + if ( acceptErrCount % 1000 || lastErrno != thisErrno ) { + fprintf ( stderr, "Accept Error %d\n", SOCKERRNO ); } acceptErrCount++; lastErrno = thisErrno;