cleanups: unnecessary casts, unified const_1, eliminate cross-.c file

prototypes (heresy!), add spaces in places like "flags&NETSTAT_CONNECTED",
removed unused #defines, #ifdef -> #if, use uint32_t for ipv4 addrs.
This commit is contained in:
Denis Vlasenko
2007-01-22 14:12:08 +00:00
parent 6cd2d2bcba
commit 703e20235a
17 changed files with 231 additions and 260 deletions

View File

@ -9,14 +9,13 @@
#include <netinet/in.h>
#include "libbb.h"
static const int one = 1;
int setsockopt_reuseaddr(int fd)
{
return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &const_int_1, sizeof(const_int_1));
}
int setsockopt_broadcast(int fd)
{
return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));
return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &const_int_1, sizeof(const_int_1));
}
void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen)