From dab67980ff1d9071dae629bc0e260933e55ca7a5 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 2 Apr 2024 09:54:15 +0200 Subject: [PATCH] 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) --- pdns/misc.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.47.2