From 301b2fe2ce48073d017c9a33649d3961fa8ae2cd Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Fri, 25 May 2012 15:43:00 +0400 Subject: [PATCH] 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 Signed-off-by: Pavel Emelyanov --- log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.c b/log.c index cd1ed5362..236903382 100644 --- a/log.c +++ b/log.c @@ -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;