summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c
index e67b5953fe..2ad1179170 100644
--- a/main/main.c
+++ b/main/main.c
@@ -62,8 +62,8 @@
#include "ext/standard/credits.h"
#ifdef PHP_WIN32
#include <io.h>
-#include <fcntl.h>
#include "win32/php_registry.h"
+#include "ext/standard/flock_compat.h"
#endif
#include "php_syslog.h"
#include "Zend/zend_exceptions.h"
@@ -461,8 +461,11 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
time(&error_time);
strftime(error_time_str, sizeof(error_time_str), "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf));
len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
+#ifdef PHP_WIN32
+ php_flock(fd, 2);
+#endif
write(fd, tmp, len);
- efree(tmp);
+ efree(tmp);
close(fd);
return;
}