diff options
Diffstat (limited to 'ext/standard/syslog.c')
-rw-r--r-- | ext/standard/syslog.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 94012635ef..b1a5489cb9 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken <ssb@php.net> | + | Author: Stig Sæther Bakken <ssb@php.net> | +----------------------------------------------------------------------+ */ @@ -44,7 +44,7 @@ PHP_MINIT_FUNCTION(syslog) REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */ REGISTER_LONG_CONSTANT("LOG_ALERT", LOG_ALERT, CONST_CS | CONST_PERSISTENT); /* immediate action required */ REGISTER_LONG_CONSTANT("LOG_CRIT", LOG_CRIT, CONST_CS | CONST_PERSISTENT); /* critical conditions */ - REGISTER_LONG_CONSTANT("LOG_ERR", LOG_ERR, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_ERR", LOG_ERR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LOG_WARNING", LOG_WARNING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LOG_NOTICE", LOG_NOTICE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LOG_INFO", LOG_INFO, CONST_CS | CONST_PERSISTENT); @@ -138,10 +138,12 @@ PHP_FUNCTION(openlog) zend_long option, facility; size_t ident_len; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll", &ident, - &ident_len, &option, &facility) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(3, 3) + Z_PARAM_STRING(ident, ident_len) + Z_PARAM_LONG(option) + Z_PARAM_LONG(facility) + ZEND_PARSE_PARAMETERS_END(); + if (BG(syslog_device)) { free(BG(syslog_device)); } @@ -179,10 +181,10 @@ PHP_FUNCTION(syslog) char *message; size_t message_len; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &priority, - &message, &message_len) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_LONG(priority) + Z_PARAM_STRING(message, message_len) + ZEND_PARSE_PARAMETERS_END(); php_syslog(priority, "%s", message); RETURN_TRUE; |