diff options
author | Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> | 2009-08-07 21:16:46 +0900 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2009-08-07 16:44:15 +0200 |
commit | 29436ed2ec4bc3b7d67329718e4bef910b79a7a6 (patch) | |
tree | 1b3e01990b0d370a4ec2e7d6ae2980f030771bd4 | |
parent | 56723c7cfbc55d8e4c609f2b4deb5664030b42f1 (diff) | |
download | mce-test-29436ed2ec4bc3b7d67329718e4bef910b79a7a6.tar.gz |
tinjpage: use O_RDWR flag for open before write
In file dirty case, it tries to write some data to a test file
opened with O_RDONLY. It gets an unexpected error. Fix it by
opening the file with O_RDWR flag.
Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r-- | tsrc/tinjpage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tsrc/tinjpage.c b/tsrc/tinjpage.c index 954e1ed..e06c87b 100644 --- a/tsrc/tinjpage.c +++ b/tsrc/tinjpage.c @@ -291,7 +291,7 @@ static void file_dirty(void) close(fd); munmap_reserve(page, PS); - fd = open(fn, O_RDONLY); + fd = open(fn, O_RDWR); char buf[128]; expecterr("explicit read after poison", read(fd, buf, sizeof buf)); expecterr("explicit write after poison", write(fd, "foobar", 6)); |