php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51118
Patch php-syslog.v4.patch.txt revision 2011-07-05 13:31 UTC by fat@php.net
Patch php-syslog.patch revision 2011-01-30 13:31 UTC by fat@php.net
revision 2011-01-30 13:23 UTC by fat@php.net
revision 2011-01-30 10:58 UTC by fat@php.net
Patch php_syslog_multiple_context.patch revision 2011-01-29 13:02 UTC by fat@php.net
revision 2010-07-23 03:23 UTC by fat@php.net

Patch php_syslog_multiple_context.patch for *General Issues Bug #51118

Patch version 2010-07-23 03:23 UTC

Return to Bug #51118 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions: 2011-01-29 13:02 UTC | 2010-07-23 03:23 UTC

Developer: fat@php.net


 Index: ext/standard/syslog.c
 Index: syslog.c
  ===================================================================
 --- ext/standard/syslog.c	(r�vision 307840)
 +++ ext/standard/syslog.c	(copie de travail)
 --- syslog.c	(r�vision 301478)
 +++ syslog.c	(copie de travail)
  @@ -36,10 +36,26 @@
   #include "basic_functions.h"
   #include "php_ext_syslog.h"
   


  -		free(BG(syslog_device));
  -		BG(syslog_device)=NULL;
  +	if (zcontext) {
  +		ZEND_FETCH_RESOURCE(context, php_syslog_context*, &zcontext, -1, PHP_SYSLOG_RES_NAME, le_syslog);
 +		if (context && strcmp(context->ident, BG(syslog_device)) != 0) {
 +		if (strcmp(context->ident, BG(syslog_device)) != 0) {
  +			close = 0;
  +		}
  +		zend_list_delete(Z_LVAL_P(zcontext));
   	}


   	}
   
  +	if (zcontext) {
  +		ZEND_FETCH_RESOURCE(context, php_syslog_context*, &zcontext, -1, PHP_SYSLOG_RES_NAME, le_syslog);
 +		if (context && (BG(syslog_device) == NULL || strcmp(BG(syslog_device), context->ident) != 0)) {
 +		if (BG(syslog_device) == NULL || strcmp(BG(syslog_device), context->ident) != 0) {
  +			if (BG(syslog_device)) {
  +				free(BG(syslog_device));
  +			}
  +			BG(syslog_device) = zend_strndup(context->ident, strlen(context->ident));


  +
   	php_syslog(priority, "%s", message);
   	RETURN_TRUE;
   }
 Index: ext/standard/php_ext_syslog.h
 Index: php_ext_syslog.h
  ===================================================================
 --- ext/standard/php_ext_syslog.h	(r�vision 307840)
 +++ ext/standard/php_ext_syslog.h	(copie de travail)
 --- php_ext_syslog.h	(r�vision 301478)
 +++ php_ext_syslog.h	(copie de travail)
  @@ -25,6 +25,14 @@
   
   #include "php_syslog.h"
   
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 18:01:31 2024 UTC