From eb6d78ce7688b329431cecab00075f65f8f181d0 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 27 Jun 2019 11:34:51 +0200 Subject: [PATCH] Fix #78212: No output Since syslog's ident and facility parameters have been added to config[1], vsyslog() segfaults on Windows, if openlog() has not been called before. We bring back the removed lines to fix this. [1] --- win32/wsyslog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win32/wsyslog.c b/win32/wsyslog.c index 695c7db8cd11e..9050b40381ce3 100644 --- a/win32/wsyslog.c +++ b/win32/wsyslog.c @@ -95,6 +95,10 @@ void vsyslog(int priority, const char *message, va_list args) DWORD evid; wchar_t *strsw[2]; + /* default event source */ + if (INVALID_HANDLE_VALUE == PW32G(log_source)) + openlog("php", LOG_PID, LOG_SYSLOG); + switch (priority) { /* translate UNIX type into NT type */ case LOG_ALERT: etype = EVENTLOG_ERROR_TYPE;