svn: /php/php-src/ branches/PHP_5_3/ext/standard/config.m4 branches/PHP_5_3/ext/standard/php_crypt_r.c trunk/ext/standard/config.m4
trunk/ext/standard/php_crypt_r.c
| From: | Pierre Joye | Date: | Thu, 17 Jun 2010 10:22:03 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/ext/standard/config.m4 branches/PHP_5_3/ext/standard/php_crypt_r.c trunk/ext/standard/config.m4 trunk/ext/standard/php_crypt_r.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-62908@lists.php.net to get a copy of this message | ||
pajoye Thu, 17 Jun 2010 10:22:03 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=300511
Log:
- #51424, solaris part
Bug: http://bugs.php.net/51424 (Assigned) crypt() function
hangs after 3rd call
Changed paths:
U php/php-src/branches/PHP_5_3/ext/standard/config.m4
U php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c
U php/php-src/trunk/ext/standard/config.m4
U php/php-src/trunk/ext/standard/php_crypt_r.c
Modified: php/php-src/branches/PHP_5_3/ext/standard/config.m4
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/config.m4 2010-06-17 09:26:29 UTC (rev 300510)
+++ php/php-src/branches/PHP_5_3/ext/standard/config.m4 2010-06-17 10:22:03 UTC (rev 300511)
@@ -567,6 +567,11 @@
fi
dnl
+dnl Check for atomic operation API availability in Solaris
+dnl
+AC_CHECK_HEADERS([atomic.h])
+
+dnl
dnl Setup extension sources
dnl
PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
Modified: php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c 2010-06-17 09:26:29 UTC (rev 300510)
+++ php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c 2010-06-17 10:22:03 UTC (rev 300511)
@@ -42,7 +42,11 @@
# include <Wincrypt.h>
#endif
-#include <signal.h>
+#ifdef HAVE_ATOMIC_H /* Solaris 10 defines atomic API within */
+# include <atomic.h>
+#else
+# include <signal.h>
+#endif
#include "php_crypt_r.h"
#include "crypt_freesec.h"
@@ -77,6 +81,8 @@
{
#ifdef PHP_WIN32
LONG volatile initialized = 0;
+#elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ volatile unsigned int initialized = 0;
#else
static volatile sig_atomic_t initialized = 0;
#endif
@@ -90,6 +96,9 @@
InterlockedIncrement(&initialized);
#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR >= 2))
__sync_fetch_and_add(&initialized, 1);
+#elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ membar_producer();
+ atomic_add_int(&initialized, 1);
#endif
_crypt_extended_init();
}
Modified: php/php-src/trunk/ext/standard/config.m4
===================================================================
--- php/php-src/trunk/ext/standard/config.m4 2010-06-17 09:26:29 UTC (rev 300510)
+++ php/php-src/trunk/ext/standard/config.m4 2010-06-17 10:22:03 UTC (rev 300511)
@@ -567,6 +567,11 @@
fi
dnl
+dnl Check for atomic operation API availability in Solaris
+dnl
+AC_CHECK_HEADERS([atomic.h])
+
+dnl
dnl Setup extension sources
dnl
PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
Modified: php/php-src/trunk/ext/standard/php_crypt_r.c
===================================================================
--- php/php-src/trunk/ext/standard/php_crypt_r.c 2010-06-17 09:26:29 UTC (rev 300510)
+++ php/php-src/trunk/ext/standard/php_crypt_r.c 2010-06-17 10:22:03 UTC (rev 300511)
@@ -42,7 +42,11 @@
# include <Wincrypt.h>
#endif
-#include <signal.h>
+#ifdef HAVE_ATOMIC_H /* Solaris 10 defines atomic API within */
+# include <atomic.h>
+#else
+# include <signal.h>
+#endif
#include "php_crypt_r.h"
#include "crypt_freesec.h"
@@ -77,6 +81,8 @@
{
#ifdef PHP_WIN32
LONG volatile initialized = 0;
+#elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ volatile unsigned int initialized = 0;
#else
static volatile sig_atomic_t initialized = 0;
#endif
@@ -90,6 +96,9 @@
InterlockedIncrement(&initialized);
#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR >= 2))
__sync_fetch_and_add(&initialized, 1);
+#elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ membar_producer();
+ atomic_add_int(&initialized, 1);
#endif
_crypt_extended_init();
}