From bc6f622612e9bcf57c2043c69a4ed83c25341a91 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sun, 22 Apr 2018 10:04:13 +1200 Subject: [PATCH] Add comment explaining why DIR's fd is OK --- xapian-core/tests/harness/fdtracker.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xapian-core/tests/harness/fdtracker.cc b/xapian-core/tests/harness/fdtracker.cc index 00c9928d6..22615117d 100644 --- a/xapian-core/tests/harness/fdtracker.cc +++ b/xapian-core/tests/harness/fdtracker.cc @@ -65,6 +65,9 @@ FDTracker::init() if (!dir) return; dir_void = static_cast(dir); + // The list of fds we get will include the fd inside dir, but that's OK as + // we keep dir open while the testcase runs and use it to recheck the open + // fds at the end. while (true) { errno = 0; struct dirent * entry = readdir(dir); -- 2.11.4.GIT