]> granicus.if.org Git - php/commitdiff
Fix thread-safety bug in bcmath
authorZeev Suraski <zeev@php.net>
Sat, 18 Nov 2000 02:59:31 +0000 (02:59 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 18 Nov 2000 02:59:31 +0000 (02:59 +0000)
ext/bcmath/bcmath.c
ext/bcmath/php_bcmath.h

index 4ec3f1d79816cf769ae19dea84f1b18e7f0dafe3..78a2521b8c3b726be8f6360359063b4455462768 100644 (file)
@@ -42,10 +42,10 @@ function_entry bcmath_functions[] = {
 zend_module_entry bcmath_module_entry = {
        "bcmath",
     bcmath_functions,
-       NULL,
-       NULL,
+       PHP_MINIT(bcmath),
+       PHP_MSHUTDOWN(bcmath),
        PHP_RINIT(bcmath),
-       PHP_RSHUTDOWN(bcmath),
+       NULL,
        PHP_MINFO(bcmath),
        STANDARD_MODULE_PROPERTIES
 };
@@ -58,21 +58,30 @@ ZEND_GET_MODULE(bcmath)
 static long bc_precision;
 #endif
 
-PHP_RINIT_FUNCTION(bcmath)
+PHP_MINIT_FUNCTION(bcmath)
 {
        init_numbers();
-       if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) {
-               bc_precision=0;
-       }
        return SUCCESS;
 }
 
-PHP_RSHUTDOWN_FUNCTION(bcmath)
+
+
+PHP_MSHUTDOWN_FUNCTION(bcmath)
 {
        destruct_numbers();
        return SUCCESS;
 }
 
+
+PHP_RINIT_FUNCTION(bcmath)
+{
+       if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) {
+               bc_precision=0;
+       }
+       return SUCCESS;
+}
+
+
 PHP_MINFO_FUNCTION(bcmath)
 {
   php_info_print_table_start();
index df7512d842e5a99ac2cbfe4ac90096ea6651566b..724484743a9034ef9087b34c94347c7929db04a9 100644 (file)
@@ -26,8 +26,9 @@
 extern zend_module_entry bcmath_module_entry;
 #define phpext_bcmath_ptr &bcmath_module_entry
 
-extern PHP_RINIT_FUNCTION(bcmath);
-extern PHP_RSHUTDOWN_FUNCTION(bcmath);
+PHP_MINIT_FUNCTION(bcmath);
+PHP_MSHUTDOWN_FUNCTION(bcmath);
+PHP_RINIT_FUNCTION(bcmath);
 PHP_MINFO_FUNCTION(bcmath);
 
 PHP_FUNCTION(bcadd);