aboutsummaryrefslogtreecommitdiff
path: root/tests/testutils.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2006-12-04 15:30:43 -0800
committerNishanth Aravamudan <nacc@us.ibm.com>2006-12-04 15:30:43 -0800
commit3dace66a12db6968c881b2fd4ff15b92cda1f4fe (patch)
tree3861c004b48bb207a2ba160d3d0d069c5394b75a /tests/testutils.c
parent02130b5f37be4d144e94b7f311626d13b8235d75 (diff)
downloadlibhugetlbfs-3dace66a12db6968c881b2fd4ff15b92cda1f4fe.tar.gz
Fix the linkshare testcase
The linkshare testcase has a number of problems, which cause it to fail unexpectedly. But, because the children's return status was not being checked, we, in error, PASS the test when we should FAIL. Fix this and reorganize the code to make it more sane to parse and debug. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Diffstat (limited to 'tests/testutils.c')
-rw-r--r--tests/testutils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/testutils.c b/tests/testutils.c
index 11316b6..b39aa75 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -171,15 +171,20 @@ ino_t get_addr_inode(void *p)
return -1;
}
- /* looks like a filename? */
+ /* Don't care about non-filenames */
if (name[0] != '/')
return 0;
/* Truncate the filename portion */
ret = stat(name, &sb);
- if (ret < 0)
+ if (ret < 0) {
+ /* Don't care about unlinked files */
+ if (errno == ENOENT)
+ return 0;
+ ERROR("stat failed: %s\n", strerror(errno));
return -1;
+ }
return sb.st_ino;
}