2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

zdtm: open log files with O_APPEND

I'm a paranoiac.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2012-05-11 17:37:00 +04:00 committed by Pavel Emelyanov
parent 33051cd3b3
commit f53888480e

View File

@ -46,11 +46,11 @@ void dump_msg(const char *fname)
if (msg_buf.ptr != msg_buf.buffer) { if (msg_buf.ptr != msg_buf.buffer) {
int fd; int fd;
if (proc_id == 0) { 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 { } else {
char fname_child[1000]; char fname_child[1000];
snprintf(fname_child,1000,"%s.%d",fname,proc_id); 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) if (fd < 0)
return; return;