From: Remi Gacogne Date: Tue, 2 Apr 2024 07:54:15 +0000 (+0200) Subject: FDWrapper: Always reset the internal descriptor to -1 X-Git-Tag: rec-5.1.0-alpha1~67^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eefbe57feca72af4a088e8e872e864dc36e9284e;p=thirdparty%2Fpdns.git FDWrapper: Always reset the internal descriptor to -1 Even if it was a different negative value, which happens for example with the bpf helper functions which return `-errno`. --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 61116f20ab..e9a0dad36a 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -826,8 +826,8 @@ struct FDWrapper int ret = 0; if (d_fd >= 0) { ret = close(d_fd); - d_fd = -1; } + d_fd = -1; return ret; }