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:
parent
33051cd3b3
commit
f53888480e
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user