From e1f36e341a4ff513f8ba1f9908326f159edca4e7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Mar 2016 13:33:37 +0200 Subject: [ci skip] Move flock() call in CI_Log::write_log() immediately after fopen() --- system/core/Log.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core') diff --git a/system/core/Log.php b/system/core/Log.php index 7c81d358b..1abdaa00e 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -191,6 +191,8 @@ class CI_Log { return FALSE; } + flock($fp, LOCK_EX); + // Instantiating DateTime with microseconds appended to initial date is needed for proper support of this format if (strpos($this->_date_fmt, 'u') !== FALSE) { @@ -206,8 +208,6 @@ class CI_Log { $message .= $this->_format_line($level, $date, $msg); - flock($fp, LOCK_EX); - for ($written = 0, $length = strlen($message); $written < $length; $written += $result) { if (($result = fwrite($fp, substr($message, $written))) === FALSE) -- cgit v1.2.3-24-g4f1b