cvs: php-src /ext/standard basic_functions.c php_ext_syslog.h syslog.c

From: Date: Mon, 20 Mar 2006 23:07:31 +0000
Subject: cvs: php-src /ext/standard basic_functions.c php_ext_syslog.h syslog.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-37371@lists.php.net to get a copy of this message
tony2001 Mon Mar 20 23:07:31 2006 UTC Modified files: /php-src/ext/standard basic_functions.c php_ext_syslog.h syslog.c Log: MF51: fix #36808 (syslog ident becomes garbage between requests) http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?r1=1.763&r2=1.764&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.763 php-src/ext/standard/basic_functions.c:1.764 --- php-src/ext/standard/basic_functions.c:1.763 Fri Mar 17 14:53:57 2006 +++ php-src/ext/standard/basic_functions.c Mon Mar 20 23:07:31 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.763 2006/03/17 14:53:57 derick Exp $ */ +/* $Id: basic_functions.c,v 1.764 2006/03/20 23:07:31 tony2001 Exp $ */ #include "php.h" #include "php_streams.h" @@ -1113,6 +1113,9 @@ PHP_MSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(file)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(standard_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU); +#ifdef HAVE_SYSLOG_H + PHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU); +#endif #if defined(HAVE_LOCALECONV) && defined(ZTS) PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/php_ext_syslog.h?r1=1.13&r2=1.14&diff_format=u Index: php-src/ext/standard/php_ext_syslog.h diff -u php-src/ext/standard/php_ext_syslog.h:1.13 php-src/ext/standard/php_ext_syslog.h:1.14 --- php-src/ext/standard/php_ext_syslog.h:1.13 Sun Jan 1 13:09:55 2006 +++ php-src/ext/standard/php_ext_syslog.h Mon Mar 20 23:07:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ext_syslog.h,v 1.13 2006/01/01 13:09:55 sniper Exp $ */ +/* $Id: php_ext_syslog.h,v 1.14 2006/03/20 23:07:31 tony2001 Exp $ */ #ifndef PHP_EXT_SYSLOG_H #define PHP_EXT_SYSLOG_H @@ -28,6 +28,7 @@ PHP_MINIT_FUNCTION(syslog); PHP_RINIT_FUNCTION(syslog); PHP_RSHUTDOWN_FUNCTION(syslog); +PHP_MSHUTDOWN_FUNCTION(syslog); PHP_FUNCTION(openlog); PHP_FUNCTION(syslog); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/syslog.c?r1=1.50&r2=1.51&diff_format=u Index: php-src/ext/standard/syslog.c diff -u php-src/ext/standard/syslog.c:1.50 php-src/ext/standard/syslog.c:1.51 --- php-src/ext/standard/syslog.c:1.50 Sun Jan 1 13:09:56 2006 +++ php-src/ext/standard/syslog.c Mon Mar 20 23:07:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: syslog.c,v 1.50 2006/01/01 13:09:56 sniper Exp $ */ +/* $Id: syslog.c,v 1.51 2006/03/20 23:07:31 tony2001 Exp $ */ #include "php.h" @@ -97,6 +97,7 @@ /* AIX doesn't have LOG_PERROR */ REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/ #endif + BG(syslog_device)=NULL; return SUCCESS; } @@ -109,22 +110,26 @@ } else { BG(syslog_started)=0; } - BG(syslog_device)=NULL; return SUCCESS; } PHP_RSHUTDOWN_FUNCTION(syslog) { - if (BG(syslog_device)) { - efree(BG(syslog_device)); - } #ifdef PHP_WIN32 closelog(); #endif return SUCCESS; } +PHP_MSHUTDOWN_FUNCTION(syslog) +{ + if (BG(syslog_device)) { + free(BG(syslog_device)); + } + return SUCCESS; +} + /* {{{ start_syslog */ static void start_syslog(TSRMLS_D) @@ -224,9 +229,9 @@ return; } if (BG(syslog_device)) { - efree(BG(syslog_device)); + free(BG(syslog_device)); } - BG(syslog_device) = estrndup(ident, ident_len); + BG(syslog_device) = zend_strndup(ident, ident_len); openlog(BG(syslog_device), option, facility); RETURN_TRUE; } @@ -242,7 +247,7 @@ closelog(); if (BG(syslog_device)) { - efree(BG(syslog_device)); + free(BG(syslog_device)); BG(syslog_device)=NULL; } RETURN_TRUE;

« previous php.cvs (#37371) next »