[CRIU] [PATCH cr] zdtm: open log files with O_APPEND

Andrey Vagin avagin at openvz.org
Fri May 11 09:37:44 EDT 2012


I'm a paranoiac.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/lib/msg.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/lib/msg.c b/test/zdtm/lib/msg.c
index 558b63d..9d33619 100644
--- a/test/zdtm/lib/msg.c
+++ b/test/zdtm/lib/msg.c
@@ -46,11 +46,11 @@ void dump_msg(const char *fname)
 	if (msg_buf.ptr != msg_buf.buffer) {
 		int fd;
 		if (proc_id == 0) {
-			fd = open(fname, O_WRONLY | O_CREAT | O_EXCL, 0644);
+			fd = open(fname, O_WRONLY | O_CREAT | O_EXCL | O_APPEND, 0644);
 		} else {
 			char fname_child[1000];
 			snprintf(fname_child,1000,"%s.%d",fname,proc_id);
-			fd = open(fname_child, O_WRONLY | O_CREAT, 0644);
+			fd = open(fname_child, O_WRONLY | O_CREAT | O_APPEND, 0644);
 		}
 		if (fd < 0)
 			return;
-- 
1.7.1



More information about the CRIU mailing list