aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-26 13:43:13 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-27 15:55:08 +0300
commita6c05d9a6033f04ded278e29b71c46a98efd6bf3 (patch)
tree0c52be5be3c49cc18600f51d87e7ccfb975f289e /tests
parent80a3b730e9b1044d689997e8d68e3b6acb71c7a3 (diff)
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/fs-tests/integrity/integck.c6
1 files changed, 3 insertions, 3 deletions
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;
}