summaryrefslogtreecommitdiffhomepage
path: root/networking/dnsd.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-12-19 16:31:09 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-12-19 16:31:09 +0000
commit28fbd69bf8a0482de2816cc189fdd0e9ed551997 (patch)
treec2d7e7b1e0b9b87748cb74b52dd3599d5500feca /networking/dnsd.c
parent359d7ca0e70d4acfc3b7e792bf28f5b5581af8ff (diff)
- use xlisten/xsocket some more. Saves .25 kB
Diffstat (limited to 'networking/dnsd.c')
-rw-r--r--networking/dnsd.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 5e9cf52f1..6f1ec0ea4 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -199,21 +199,21 @@ static int listen_socket(char *iface_addr, int listen_port)
{
struct sockaddr_in a;
char msg[100];
- int s;
- s = xsocket(PF_INET, SOCK_DGRAM, 0);
- if (setsockopt_reuseaddr(s) < 0)
+ int sck;
+ sck = xsocket(PF_INET, SOCK_DGRAM, 0);
+ if (setsockopt_reuseaddr(sck) < 0)
bb_perror_msg_and_die("setsockopt() failed");
memset(&a, 0, sizeof(a));
a.sin_port = htons(listen_port);
a.sin_family = AF_INET;
if (!inet_aton(iface_addr, &a.sin_addr))
bb_perror_msg_and_die("bad iface address");
- xbind(s, (struct sockaddr *)&a, sizeof(a));
- xlisten(s, 50);
+ xbind(sck, (struct sockaddr *)&a, sizeof(a));
+ xlisten(sck, 50);
sprintf(msg, "accepting UDP packets on addr:port %s:%d\n",
iface_addr, (int)listen_port);
log_message(LOG_FILE, msg);
- return s;
+ return sck;
}
/*
@@ -412,8 +412,6 @@ int dnsd_main(int argc, char **argv)
#endif
udps = listen_socket(listen_interface, port);
- if (udps < 0)
- exit(1);
while (1) {
fd_set fdset;