introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),

use them where appropriate. 200 bytes saved
This commit is contained in:
Denis Vlasenko
2006-11-22 23:22:06 +00:00
parent b40bdb383a
commit 48237b0c88
16 changed files with 40 additions and 42 deletions

View File

@@ -356,9 +356,7 @@ static void ping(const char *host)
#endif /*ICMP6_FILTER*/
/* enable broadcast pings */
sockopt = 1;
setsockopt(pingsock, SOL_SOCKET, SO_BROADCAST, (char *) &sockopt,
sizeof(sockopt));
setsockopt_broadcast(pingsock);
/* set recv buf for broadcast pings */
sockopt = 48 * 1024;