| getlistenfd: on setsockopt failure it could return an invalid/closed fd - geomy… | |
| git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri… | |
| Log | |
| Files | |
| Refs | |
| Tags | |
| README | |
| LICENSE | |
| --- | |
| commit cb9b6b70dbc6b33cc29364ba31023ffeb0579085 | |
| parent feed37adc1b23cac513b5d2a17bda4e2ffc77c81 | |
| Author: Hiltjo Posthuma <[email protected]> | |
| Date: Wed, 29 Aug 2018 20:18:50 +0200 | |
| getlistenfd: on setsockopt failure it could return an invalid/closed fd | |
| Signed-off-by: Christoph Lohmann <[email protected]> | |
| Diffstat: | |
| M main.c | 1 + | |
| 1 file changed, 1 insertion(+), 0 deletions(-) | |
| --- | |
| diff --git a/main.c b/main.c | |
| @@ -311,6 +311,7 @@ getlistenfd(struct addrinfo *hints, char *bindip, char *por… | |
| if (setsockopt(listfd, SOL_SOCKET, SO_REUSEADDR, &on, | |
| sizeof(on)) < 0) { | |
| close(listfd); | |
| + listfd = -1; | |
| break; | |
| } | |