aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Renninger <trennsuse.de>2012-12-12 21:14:50 -0500
committerChen, Gong <gong.chen@linux.intel.com>2015-01-21 21:24:00 -0500
commit4da149ab9462e1e8750e2db7a93fa88429eab91a (patch)
tree316943306479148bbeed0c79765439c4f9536f68
parentcfdf0d9f9564de49ec38c794fa4b151babea98f1 (diff)
downloadmce-test-4da149ab9462e1e8750e2db7a93fa88429eab91a.tar.gz
mce-test: Add file attributes to open
This fixes a compile warning. open(2) manpage says: ... mode specifies the permissions to use in case a new file is created. This argument must be supplied when O_CREAT is specified in flags; ... Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rw-r--r--cases/function/hwpoison/tinjpage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cases/function/hwpoison/tinjpage.c b/cases/function/hwpoison/tinjpage.c
index 2ea74a3..dcb973c 100644
--- a/cases/function/hwpoison/tinjpage.c
+++ b/cases/function/hwpoison/tinjpage.c
@@ -379,7 +379,7 @@ static void do_file_clean(int flags, char *name)
char *page;
char fn[30];
snprintf(fn, 30, TMPDIR "~test%d", tmpcount++);
- int fd = open(fn, O_RDWR|O_TRUNC|O_CREAT);
+ int fd = open(fn, O_RDWR|O_TRUNC|O_CREAT, 0664);
if (fd < 0)
err("open temp file");
write(fd, fn, 4);