Skip to content

Commit 5a459f6

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix GH-8923: error_log on Windows can hold the file write lock
2 parents d86141a + 77e954a commit 5a459f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.1.9
44

5+
- Core:
6+
. Fixed bug GH-8923 (error_log on Windows can hold the file write lock). (cmb)
7+
58
- CLI:
69
. Fixed GH-8952 (Intentionally closing std handles no longer possible).
710
(Arnaud, cmb)

main/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,10 @@ PHPAPI ZEND_COLD void php_log_err_with_severity(const char *log_message, int sys
832832
#endif
833833
len = spprintf(&tmp, 0, "[%s] %s%s", ZSTR_VAL(error_time_str), log_message, PHP_EOL);
834834
#ifdef PHP_WIN32
835-
php_flock(fd, 2);
835+
php_flock(fd, LOCK_EX);
836836
/* XXX should eventually write in a loop if len > UINT_MAX */
837837
php_ignore_value(write(fd, tmp, (unsigned)len));
838+
php_flock(fd, LOCK_UN);
838839
#else
839840
php_ignore_value(write(fd, tmp, len));
840841
#endif

0 commit comments

Comments
 (0)