From ef175e3cbefc184088d2778089dbb0ecde20ce50 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 4 Jul 2018 23:46:40 +0800 Subject: [PATCH] Open log file in append mode --- native/jni/core/log_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/jni/core/log_monitor.c b/native/jni/core/log_monitor.c index fb9971120..8d081192a 100644 --- a/native/jni/core/log_monitor.c +++ b/native/jni/core/log_monitor.c @@ -129,7 +129,7 @@ void log_daemon() { // Setup log dumps rename(LOGFILE, LOGFILE ".bak"); - events[LOG_EVENT].fd = xopen(LOGFILE, O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, 0644); + events[LOG_EVENT].fd = xopen(LOGFILE, O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC | O_APPEND, 0644); int log_fd = -1, log_pid; char line[PIPE_BUF];