aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-08-28 17:33:22 (GMT)
committerJouni Malinen <j@w1.fi>2015-08-28 17:33:22 (GMT)
commitf79a19746a4bdc1a9ae3d802eb10bc8398bc9e23 (patch)
tree698f11d8eba1a23996227649e1107c99443d215a /src
parent96ace55e6c2635a91f825d5842d528a120b964a5 (diff)
downloadhostap-f79a19746a4bdc1a9ae3d802eb10bc8398bc9e23.zip
hostap-f79a19746a4bdc1a9ae3d802eb10bc8398bc9e23.tar.gz
hostap-f79a19746a4bdc1a9ae3d802eb10bc8398bc9e23.tar.bz2
WPS: Merge common error paths in HTTP server
There is no need to maintain three separate "goto fail" cases. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/wps/http_server.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/wps/http_server.c b/src/wps/http_server.c
index ac088c4..507abe8 100644
--- a/src/wps/http_server.c
+++ b/src/wps/http_server.c
@@ -277,11 +277,9 @@ struct http_server * http_server_init(struct in_addr *addr, int port,
"%s", srv->port, strerror(errno));
goto fail;
}
- if (listen(srv->fd, 10 /* max backlog */) < 0)
- goto fail;
- if (fcntl(srv->fd, F_SETFL, O_NONBLOCK) < 0)
- goto fail;
- if (eloop_register_sock(srv->fd, EVENT_TYPE_READ, http_server_cb,
+ if (listen(srv->fd, 10 /* max backlog */) < 0 ||
+ fcntl(srv->fd, F_SETFL, O_NONBLOCK) < 0 ||
+ eloop_register_sock(srv->fd, EVENT_TYPE_READ, http_server_cb,
srv, NULL))
goto fail;