From eefbe57feca72af4a088e8e872e864dc36e9284e 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`. --- pdns/misc.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.2