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: dnsdist-1.9.2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14015%2Fhead;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`. (cherry picked from commit eefbe57feca72af4a088e8e872e864dc36e9284e) --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 46e93f7ec1..76887ee69c 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -824,9 +824,9 @@ struct FDWrapper void reset() { if (d_fd >= 0) { - ::close(d_fd); - d_fd = -1; + close(d_fd); } + d_fd = -1; } private: