mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +00:00
log: Open logc files with O_TRUNC
It's really confusing when one use -o option and didn't see update on top of log file. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
eb12c976a3
commit
301b2fe2ce
2
log.c
2
log.c
@@ -42,7 +42,7 @@ int log_init(const char *output)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (output) {
|
if (output) {
|
||||||
new_logfd = open(output, O_CREAT | O_WRONLY | O_APPEND, 0600);
|
new_logfd = open(output, O_CREAT | O_TRUNC | O_WRONLY | O_APPEND, 0600);
|
||||||
if (new_logfd < 0) {
|
if (new_logfd < 0) {
|
||||||
pr_perror("Can't create log file %s", output);
|
pr_perror("Can't create log file %s", output);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user