Commit f5388848 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: open log files with O_APPEND

I'm a paranoiac.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 33051cd3
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment