From 5ca5f1109225f2e49998f8bfae81ac9a7638caf7 Mon Sep 17 00:00:00 2001 From: Alex Tran Qui Date: Tue, 7 Nov 2017 14:34:54 +0100 Subject: [PATCH] =?UTF-8?q?libdill=20has=20SO=5FLINGER=20turned=20off=20wh?= =?UTF-8?q?ich=20means=20the=20second=20you=20close=20a=20descriptor=20it?= =?UTF-8?q?=E2=80=99s=20remaining=20bytes=20are=20not=20flushed=20but=20ra?= =?UTF-8?q?ther=20are=20lost.=20So=20turned=20it=20on.=20thx=20to=20@rober?= =?UTF-8?q?tjpayne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fd.c b/fd.c index 5f7e593b..493f92f7 100644 --- a/fd.c +++ b/fd.c @@ -291,7 +291,7 @@ void fd_close(int s) { be set, never mind and continue anyway. */ struct linger lng; lng.l_onoff=1; - lng.l_linger=0; + lng.l_linger=1; setsockopt(s, SOL_SOCKET, SO_LINGER, (void*)&lng, sizeof(lng)); /* We are not checking the error here. close() has inconsistent behaviour and leaking a file descriptor is better than crashing the entire