[1/2] has the side effect of flipping test stat06 from working to failing.
[2/2] fixes that

When run with TDIRECTORY set, libltp just uses that directory and assumes
something else will clean it up.

When TDIRECTORY is not set, libltp creates a subdirectory under /tmp, and when
the test is completed, removes the expected files and verifies that the
directory is empty.

stat06 fails that check, because it creates the a file named "file" there, and
tries stat("file", -1), testing that it returns the expected value EFAULT.

"file" is removed, but lingers in the STATUS_DELETE_PENDING state until the
Windows handle which stat_worker() leaks when an exception occurs is closed
(when the processes exits).

Future work: It looks like similar problems might generically occur in similar
code througout syscalls.cc.

Jon Turney (2):
  Cygwin: testsuite: Drop setting TDIRECTORY
  Cygwin: Fix Windows file handle leak in stat("file", -1)

 winsup/cygwin/syscalls.cc              | 6 +++---
 winsup/testsuite/Makefile.am           | 8 --------
 winsup/testsuite/cygrun.c              | 5 +----
 winsup/testsuite/winsup.api/winsup.exp | 4 +---
 4 files changed, 5 insertions(+), 18 deletions(-)

-- 
2.39.0

Reply via email to