summaryrefslogtreecommitdiff
path: root/listen.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-12-31 17:40:23 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-12-31 17:40:23 +0100
commitb6d9114baa1f8323084001fd4bc44fb08f7f1b35 (patch)
treea1da9ac31d61dac1c337bedcff29805061c9ff54 /listen.c
parent57fc4cd7ff5918af11eb4b5f6ad765c89432b210 (diff)
exit if no sockets could be bound
Diffstat (limited to 'listen.c')
-rw-r--r--listen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/listen.c b/listen.c
index 7e59d1d..13054fb 100644
--- a/listen.c
+++ b/listen.c
@@ -98,7 +98,7 @@ int uh_socket_bind(const char *host, const char *port, bool tls)
if ((status = getaddrinfo(host, port, &hints, &addrs)) != 0) {
fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(status));
- return -1;
+ return 0;
}
/* try to bind a new socket to each found address */
@@ -163,6 +163,7 @@ int uh_socket_bind(const char *host, const char *port, bool tls)
l->fd.fd = sock;
l->tls = tls;
list_add_tail(&l->list, &listeners);
+ bound++;
continue;