[LTP] [PATCH] syscalls: close open files in cleanup

Cyril Hrubis chrubis@suse.cz
Mon Mar 21 14:04:39 CET 2016


Hi!
> NFS creates special .nfs* files when test file was removed and
> left open. In that case, tst_rmdir() fails to remove test dirs.
> 
> Close left open files in cleanup and replace some of safe_open()
> calls with safe_file_printf() ones for test files which fd won't
> be used in a test.

I would be closing the file descriptors only if they were initialized
with value > 0, since otherwise there would be misleading failing close
in the strace in case that some setup step prior to the SAFE_OPEN()
failed.

Otherwise it looks good.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list