From a6c05d9a6033f04ded278e29b71c46a98efd6bf3 Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Date: Thu, 26 May 2011 13:43:13 +0300
Subject: fs-tests: integck: close files after creation

The 'file_new()' function should create a file but should not keep it
open. There is a different path to open files and keep them open. This
patch makes 'file_new()' close newly created files.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 tests/fs-tests/integrity/integck.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'tests/fs-tests/integrity')

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 748b6cb..8b1fb40 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -633,7 +633,6 @@ static int dir_remove(struct dir_info *dir)
 
 static int file_new(struct dir_info *parent, const char *name)
 {
-	struct file_info *file;
 	char *path;
 	mode_t mode;
 	int fd;
@@ -661,9 +660,10 @@ static int file_new(struct dir_info *parent, const char *name)
 		CHECK(lstat(path, &st) == 0);
 		CHECK(S_ISREG(st.st_mode));
 	}
-	file = add_dir_entry(parent, 'f', name, NULL);
-	add_fd(file, fd);
 
+	add_dir_entry(parent, 'f', name, NULL);
+
+	close(fd);
 	free(path);
 	return 0;
 }
-- 
cgit v1.2.3