summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2007-04-18 09:48:07 +0000
committerRob Richards <rrichards@php.net>2007-04-18 09:48:07 +0000
commitc88e2b7618344f9e8f652b6a44627a537367bfee (patch)
tree581ae9190d6caec2821b28212704cdb30c5c856e /main
parent294231954713f9a6a9a1d16ee7fe19df23c5c637 (diff)
downloadphp-git-c88e2b7618344f9e8f652b6a44627a537367bfee.tar.gz
MFB: add file locking under windows
change win build to use common clock compat files
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;
}