fixed base to use close on exec options whenever creating a socket

on posix compliant systems
This commit is contained in:
Jeff Hill
2003-07-16 17:45:09 +00:00
parent a907bc4df3
commit b697fc2acc
30 changed files with 170 additions and 131 deletions
+2 -2
View File
@@ -1090,7 +1090,7 @@ int TSgetBroadcastSocket(int port, struct sockaddr_in* sin)
sin->sin_port=htons(port);
sin->sin_family=AF_INET;
sin->sin_addr.s_addr=htonl(INADDR_ANY);
if( (soc=socket(AF_INET,SOCK_DGRAM,0)) < 0 )
if( (soc=epicsSocketCreate(AF_INET,SOCK_DGRAM,0)) < 0 )
{ perror("socket create failed"); return -1; }
setsockopt(soc,SOL_SOCKET,SO_BROADCAST,(char*)&on,sizeof(on));
@@ -1688,7 +1688,7 @@ static int TSgetSocket(int port, struct sockaddr_in* sin)
sin->sin_port=htons(port);
sin->sin_family=AF_INET;
sin->sin_addr.s_addr=htonl(INADDR_ANY);
if( (soc=socket(AF_INET,SOCK_DGRAM,0)) < 0 )
if( (soc=epicsSocketCreate(AF_INET,SOCK_DGRAM,0)) < 0 )
{ perror("socket create failed"); return -1; }
Debug(5,"sizeof sin = %d\n", (int) sizeof(struct sockaddr_in));
if( bind(soc,(struct sockaddr*)sin,sizeof(struct sockaddr_in)) < 0 )