* [PATCH] t_readdir_3: Allow EOF on ignore_error
@ 2026-01-04 10:28 Shahar Hochma
2026-01-07 8:25 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Shahar Hochma @ 2026-01-04 10:28 UTC (permalink / raw)
To: fstests; +Cc: Shahar Hochma
ignore_error is used when providing random input to setpos.
This can, by chance, produce a valid response from readdir,
but with EOF. In which case, we don't want the test to fail.
Signed-off-by: Shahar Hochma <shaharhoch@gmail.com>
---
src/t_readdir_3.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/t_readdir_3.c b/src/t_readdir_3.c
index 8f9bb326..5d7afddc 100644
--- a/src/t_readdir_3.c
+++ b/src/t_readdir_3.c
@@ -52,12 +52,12 @@ static void libc_getentry(struct dirent *entry)
errno = 0;
ret = readdir(dir);
if (!ret) {
+ if (ignore_error)
+ return;
if (errno == 0) {
fprintf(stderr, "Unexpected EOF while reading dir.\n");
exit(1);
}
- if (ignore_error)
- return;
perror("readdir");
exit(1);
}
@@ -92,6 +92,8 @@ static void kernel_getentry(struct dirent *entry)
exit(1);
}
if (ret == 0) {
+ if (ignore_error)
+ return;
fprintf(stderr, "Unexpected EOF while reading dir.\n");
exit(1);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-07 8:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-04 10:28 [PATCH] t_readdir_3: Allow EOF on ignore_error Shahar Hochma
2026-01-07 8:25 ` Christoph Hellwig
[not found] ` <CAHeNByfyTHSL-UHboz_8OtcdXDDfxA+BJ_awkVw3s_50c61e5g@mail.gmail.com>
2026-01-07 8:41 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox