2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +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:
Cyrill Gorcunov
2012-05-25 15:43:00 +04:00
committed by Pavel Emelyanov
parent eb12c976a3
commit 301b2fe2ce

2
log.c
View File

@@ -42,7 +42,7 @@ int log_init(const char *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) {
pr_perror("Can't create log file %s", output);
return -1;