summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_accelerator_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/zend_accelerator_debug.c')
-rw-r--r--ext/opcache/zend_accelerator_debug.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/ext/opcache/zend_accelerator_debug.c b/ext/opcache/zend_accelerator_debug.c
index f91c269975..a3db2a7215 100644
--- a/ext/opcache/zend_accelerator_debug.c
+++ b/ext/opcache/zend_accelerator_debug.c
@@ -28,9 +28,8 @@
#endif
#include "ZendAccelerator.h"
-void zend_accel_error(int type, const char *format, ...)
+static void zend_accel_error_va_args(int type, const char *format, va_list args)
{
- va_list args;
time_t timestamp;
char *time_string;
FILE * fLog = NULL;
@@ -77,9 +76,7 @@ void zend_accel_error(int type, const char *format, ...)
break;
}
- va_start(args, format);
vfprintf(fLog, format, args);
- va_end(args);
fprintf(fLog, "\n");
fflush(fLog);
@@ -98,3 +95,22 @@ void zend_accel_error(int type, const char *format, ...)
}
}
+
+void zend_accel_error(int type, const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ zend_accel_error_va_args(type, format, args);
+ va_end(args);
+}
+
+ZEND_NORETURN void zend_accel_error_noreturn(int type, const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ ZEND_ASSERT(type == ACCEL_LOG_FATAL || type == ACCEL_LOG_ERROR);
+ zend_accel_error_va_args(type, format, args);
+ va_end(args);
+ /* Should never reach this. */
+ abort();
+}