Something goes wrong if we are allowed to read, or
we are not allowed to read, but we've got unexpected errno.
---
testcases/kernel/io/direct_io/diotest4.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/testcases/kernel/io/direct_io/diotest4.c
b/testcases/kernel/io/direct_io/diotest4.c
index 1debd82..3546a50 100644
--- a/testcases/kernel/io/direct_io/diotest4.c
+++ b/testcases/kernel/io/direct_io/diotest4.c
@@ -298,7 +298,7 @@ main(int argc, char *argv[])
}
else {
ret = read(fd, buf2, count);
- if (ret < 0) { //Check Error Condition only when read() returns
< 0
+ if (ret > 0 || (ret < 0 && errno != EINVAL)) {
tst_resm(TFAIL,"allows read beyond file size. returns
%d: %s",
ret, strerror(errno));
failed = TRUE;
--
1.5.4.1
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list