Commit 301b2fe2 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent eb12c976
...@@ -42,7 +42,7 @@ int log_init(const char *output) ...@@ -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;
......
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