syscall/dup03: Close all open files in cleanup
PATCH 1/1 syscall/dup03: Close all open files in cleanup
The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in NFS mount. The cleanup() in dup03.c doesn't close all open files and leaves .nfsXXX file in the testing directory. Then rmdir(2) complains about "Directory not empty".
dup03 1 TPASS : dup failed as expected with EMFILE dup03 0 TWARN : tst_rmdir: rmobj(/mnt/nfs/dupxesX9v) failed: remove(/mnt/nfs/dupxesX9v) failed; errno=39: Directory not empty
So close all open files in cleanup().
--- testcases/kernel/syscalls/dup/dup03.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/dup/dup03.c +2 -2
@@ -217,8 +217,8 @@ void cleanup()TEST_CLEANUP ; -for (i =3 ; i <= nfds; i++) +for (i =0 ; i <= nfds; i++)close (fd[i]);tst_rmdir (); -} +}
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 6 lines · Eryu Guan
The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in NFS mount. The
cleanup()indup03.cdoesn't close all open files and leaves .nfsXXX file in the testing directory. Then rmdir(2) complains about "Directory not empty".
Quoted 6 lines
dup03 1 TPASS : dup failed as expected with EMFILE dup03 0 TWARN : tst_rmdir: rmobj(/mnt/nfs/dupxesX9v) failed: remove(/mnt/nfs/dupxesX9v) failed; errno=39: Directory not emptySo close all open files in
cleanup().Signed-off-by Eryu Guan <[email protected]>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 4 lines
The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in NFS mount. The
cleanup()indup03.cdoesn't close all open files and leaves .nfsXXX file in the testing directory. Then rmdir(2) complains about "Directory not empty".
Comited, thanks.
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list