[CRIU] [PATCH] zdtm: open with O_CREAT in second argument needs 3 arguments

vkonyashkin vkonyashkin at parallels.com
Tue May 29 09:46:56 EDT 2012


The mode argument must be supplied when O_CREAT is specified in flags.
Otherwise it will cause compile error due to -Werror is specified.
---
 test/zdtm/live/static/file_shared.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/live/static/file_shared.c b/test/zdtm/live/static/file_shared.c
index cf106f7..b385d78 100644
--- a/test/zdtm/live/static/file_shared.c
+++ b/test/zdtm/live/static/file_shared.c
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
 
 	test_init(argc, argv);
 
-	fd = open(filename, O_RDWR | O_CREAT);
+	fd = open(filename, O_RDWR | O_CREAT, 0644);
 	if (fd == -1)
 		return 1;
 
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
 	if (fd < 0)
 		return 1;
 
-	fd3 = open(filename, O_RDWR | O_CREAT);
+	fd3 = open(filename, O_RDWR | O_CREAT, 0644);
 	if (fd3 == -1)
 		return 1;
 
-- 
1.5.2.2



More information about the CRIU mailing list