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

@ -175,8 +175,7 @@ int ether_wake_main(int argc, char *argv[])
/* This is necessary for broadcasts to work */
if (flags /*& 1 [OPT_BROADCAST]*/) {
int one = 1;
if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, (void *)&one, sizeof(one)) < 0)
if (setsockopt_broadcast(s) < 0)
bb_perror_msg("SO_BROADCAST");
}