From: Anton G. <agl...@pa...> - 2008-03-18 12:27:19
|
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 |