diff options
author | Rui Paulo <rpaulo@FreeBSD.org> | 2015-10-14 04:30:17 +0000 |
---|---|---|
committer | Rui Paulo <rpaulo@FreeBSD.org> | 2015-10-14 04:30:17 +0000 |
commit | b834757ea3bcd1bba3381ff7cab216458d8f7efb (patch) | |
tree | dadb24e00f30aa959ea0981e649b18c668304498 /src/wps/http_server.c | |
parent | fbffd80fb2ba16c68f799da68a119d5e69643604 (diff) |
Diffstat (limited to 'src/wps/http_server.c')
-rw-r--r-- | src/wps/http_server.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/wps/http_server.c b/src/wps/http_server.c index ac088c429d606..507abe8707808 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; |