BUG/MINOR: tcp: avoid closing fd when socket failed in tcp_bind_listener
authorWilliam Dauchy <w.dauchy@criteo.com>
Wed, 12 Feb 2020 09:09:14 +0000 (10:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Feb 2020 14:32:44 +0000 (15:32 +0100)
commit938977daf597667c589cfdf1a87bb00ba2bcfdad
tree307698be47ef9f8c83d021657d605e08a580be6a
parent507e044a18994fc8cc087ace12ab5feb553f9670
BUG/MINOR: tcp: avoid closing fd when socket failed in tcp_bind_listener

we were trying to close file descriptor even when `socket` call was
failing.
this should fix github issue #499

this should be backported to all versions >= v1.8

Fixes: 153659f1ae69a1 ("MINOR: tcp: When binding socket, attempt to
reuse one from the old proc.")
Signed-off-by: William Dauchy <w.dauchy@criteo.com>
(cherry picked from commit c0e23aef051dd3916ef3eedf934837942cb7db71)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/proto_tcp.c