From a1260d92a7e3c11e1db74ad7007332f87fc1b690 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 1 Aug 2006 06:40:11 +0000 Subject: * stdlib/test-canon.c (do_test): Close fd before unlinking file so that directory is empty even on non-POSIX filesystems. --- stdlib/test-canon.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'stdlib') diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c index 54267465b8..9261898795 100644 --- a/stdlib/test-canon.c +++ b/stdlib/test-canon.c @@ -1,5 +1,6 @@ /* Test program for returning the canonical absolute name of a given file. - Copyright (C) 1996,1997,2000,2002,2004,2005 Free Software Foundation, Inc. + Copyright (C) 1996,1997,2000,2002,2004,2005,2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger . @@ -213,7 +214,10 @@ do_test (int argc, char ** argv) } if (fd >= 0) - unlink ("doesExist/someFile"); + { + close (fd); + unlink ("doesExist/someFile"); + } if (has_dir) rmdir ("doesExist"); -- cgit v1.2.3