2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

log: Open log file with O_APPEND

Otherwise multiple writers can screw each-other's messages.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-04-11 22:06:00 +04:00
parent 1e6d32276a
commit b63451e58d

2
log.c
View File

@@ -39,7 +39,7 @@ int log_init(const char *output)
}
if (output) {
new_logfd = open(output, O_CREAT | O_WRONLY, 0600);
new_logfd = open(output, O_CREAT | O_WRONLY | O_APPEND, 0600);
if (new_logfd < 0) {
pr_perror("Can't create log file %s", output);
return -1;