findutils/findutils-4.5.7-fdleak.patch

14 lines
315 B
Diff

diff --git a/lib/fdleak.c b/lib/fdleak.c
index 2c362cf..98e0caf 100644
--- a/lib/fdleak.c
+++ b/lib/fdleak.c
@@ -186,7 +186,7 @@ static int
fd_is_cloexec (int fd)
{
const int flags = fcntl (fd, F_GETFD);
- return flags & FD_CLOEXEC;
+ return (flags & FD_CLOEXEC) || (fcntl (fd, F_GETFL) & O_CLOEXEC);
}