File tree Expand file tree Collapse file tree 3 files changed +37
-6
lines changed Expand file tree Collapse file tree 3 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ PHP_FUNCTION(syslog)
252
252
* this will cause problems.
253
253
*/
254
254
255
- syslog ((* priority )-> value .lval , (* message )-> value .str .val );
255
+ php_syslog ((* priority )-> value .lval , (* message )-> value .str .val );
256
256
RETURN_TRUE ;
257
257
}
258
258
/* }}} */
Original file line number Diff line number Diff line change 53
53
#ifdef PHP_WIN32
54
54
#include <io.h>
55
55
#include <fcntl.h>
56
- #include "win32/syslog.h"
57
56
#include "win32/php_registry.h"
58
- #else
59
- #include <syslog.h>
60
57
#endif
58
+ #include "php_syslog.h"
61
59
62
60
#if PHP_SIGCHILD
63
61
#include <sys/types.h>
@@ -251,9 +249,9 @@ void php_log_err(char *log_message)
251
249
252
250
/* Try to use the specified logging location. */
253
251
if (PG (error_log ) != NULL ) {
254
- #if HAVE_SYSLOG_H
252
+ #ifdef HAVE_SYSLOG_H
255
253
if (!strcmp (PG (error_log ), "syslog" )) {
256
- syslog (LOG_NOTICE , log_message );
254
+ php_syslog (LOG_NOTICE , log_message );
257
255
return ;
258
256
}
259
257
#endif
Original file line number Diff line number Diff line change
1
+ #ifndef PHP_SYSLOG_H
2
+ #define PHP_SYSLOG_H
3
+
4
+ #ifdef PHP_WIN32
5
+ #include "win32/syslog.h"
6
+ #include "win32/php_registry.h"
7
+ #else
8
+ #include <syslog.h>
9
+ #endif
10
+
11
+ /*
12
+ * SCO OpenServer 5 defines syslog to var_syslog/sys_syslog which
13
+ * causes trouble with our use of syslog. We define php_syslog
14
+ * to be the system function syslog.
15
+ */
16
+
17
+ #ifdef syslog
18
+
19
+ #if defined(var_syslog ) && var_syslog == syslog
20
+ #define php_syslog var_syslog
21
+ #elif defined(sys_syslog ) && sys_syslog == syslog
22
+ #define php_syslog sys_syslog
23
+ #endif
24
+
25
+ #endif
26
+
27
+ #ifndef php_syslog
28
+ #define php_syslog syslog
29
+ #undef syslog
30
+ #endif
31
+
32
+
33
+ #endif
You can’t perform that action at this time.
0 commit comments