]> granicus.if.org Git - php/commitdiff
Print error code if CreateMutex() fails
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 2 Mar 2021 11:19:43 +0000 (12:19 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 5 Mar 2021 14:06:18 +0000 (15:06 +0100)
This issue came up recently in a bug report[1]; without the error code,
users can barely guess why the function failed.

[1] <https://bugs.php.net/80812>

Closes GH-6745.

ext/opcache/shared_alloc_win32.c

index a75ec852c417ca5100dd8b2512b656fbf11c4060..4b95508ef44cab821f04c920bbac0bff9acd6ebf 100644 (file)
@@ -80,7 +80,7 @@ void zend_shared_alloc_create_lock(void)
 {
        memory_mutex = CreateMutex(NULL, FALSE, create_name_with_username(ACCEL_MUTEX_NAME));
        if (!memory_mutex) {
-               zend_accel_error(ACCEL_LOG_FATAL, "Cannot create mutex");
+               zend_accel_error(ACCEL_LOG_FATAL, "Cannot create mutex (error %u)", GetLastError());
                return;
        }
        ReleaseMutex(memory_mutex);