andrey                                   Tue, 05 Oct 2010 16:27:49 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=304112

Log:
rename parameter, should not conflict with global symbol -
the socket function

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	2010-10-05 16:26:18 UTC (rev 304111)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	2010-10-05 16:27:49 UTC (rev 304112)
@@ -549,7 +549,7 @@
 						 const char *passwd, unsigned int passwd_len,
 						 const char *db, unsigned int db_len,
 						 unsigned int port,
-						 const char *socket,
+						 const char * socket_or_pipe,
 						 unsigned int mysql_flags
 						 TSRMLS_DC)
 {
@@ -617,11 +617,11 @@
 		int transport_len;
 #ifndef PHP_WIN32
 		if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) {
-			DBG_INF_FMT("socket=%s", socket? socket:"n/a");
-			if (!socket) {
-				socket = "/tmp/mysql.sock";
+			DBG_INF_FMT("socket=%s", socket_or_pipe? socket_or_pipe:"n/a");
+			if (!socket_or_pipe) {
+				socket_or_pipe = "/tmp/mysql.sock";
 			}
-			transport_len = spprintf(&transport, 0, "unix://%s", socket);
+			transport_len = spprintf(&transport, 0, "unix://%s", socket_or_pipe);
 			unix_socket = TRUE;
 		} else
 #endif
@@ -764,7 +764,7 @@
 				}
 			}
 		} else {
-			conn->unix_socket	= mnd_pestrdup(socket, conn->persistent);
+			conn->unix_socket	= mnd_pestrdup(socket_or_pipe, conn->persistent);
 			conn->host_info		= mnd_pestrdup("Localhost via UNIX socket", conn->persistent);
 			if (!conn->unix_socket || !conn->host_info) {
 				SET_OOM_ERROR(conn->error_info);
@@ -850,7 +850,7 @@
 						 const char *passwd, unsigned int passwd_len,
 						 const char *db, unsigned int db_len,
 						 unsigned int port,
-						 const char *socket,
+						 const char *socket_or_pipe,
 						 unsigned int mysql_flags
 						 TSRMLS_DC)
 {
@@ -868,7 +868,7 @@
 		}
 	}

-	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket, mysql_flags TSRMLS_CC);
+	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);

 	if (ret == FAIL) {
 		if (self_alloced) {

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h	2010-10-05 16:26:18 UTC (rev 304111)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h	2010-10-05 16:27:49 UTC (rev 304112)
@@ -102,7 +102,7 @@
 						  const char *passwd, unsigned int passwd_len,
 						  const char *db, unsigned int db_len,
 						  unsigned int port,
-						  const char *socket,
+						  const char *socket_or_pipe,
 						  unsigned int mysql_flags
 						  TSRMLS_DC);


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h	2010-10-05 16:26:18 UTC (rev 304111)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h	2010-10-05 16:27:49 UTC (rev 304112)
@@ -337,7 +337,7 @@


 typedef enum_func_status	(*func_mysqlnd_conn__init)(MYSQLND * conn TSRMLS_DC);
-typedef enum_func_status	(*func_mysqlnd_conn__connect)(MYSQLND *conn, const char *host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket, unsigned int mysql_flags TSRMLS_DC);
+typedef enum_func_status	(*func_mysqlnd_conn__connect)(MYSQLND *conn, const char *host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
 typedef ulong				(*func_mysqlnd_conn__escape_string)(const MYSQLND * const conn, char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_conn__set_charset)(MYSQLND * const conn, const char * const charset TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_conn__query)(MYSQLND *conn, const char *query, unsigned int query_len TSRMLS_DC);

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c	2010-10-05 16:26:18 UTC (rev 304111)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c	2010-10-05 16:27:49 UTC (rev 304112)
@@ -547,7 +547,7 @@
 						 const char *passwd, unsigned int passwd_len,
 						 const char *db, unsigned int db_len,
 						 unsigned int port,
-						 const char *socket,
+						 const char *socket_or_pipe,
 						 unsigned int mysql_flags
 						 TSRMLS_DC)
 {
@@ -616,19 +616,19 @@
 		int transport_len;
 #ifndef PHP_WIN32
 		if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) {
-			DBG_INF_FMT("socket=%s", socket? socket:"n/a");
-			if (!socket) {
-				socket = "/tmp/mysql.sock";
+			DBG_INF_FMT("socket=%s", socket_or_pipe? socket_or_pipe:"n/a");
+			if (!socket_or_pipe) {
+				socket_or_pipe = "/tmp/mysql.sock";
 			}
-			transport_len = spprintf(&transport, 0, "unix://%s", socket);
+			transport_len = spprintf(&transport, 0, "unix://%s", socket_or_pipe);
 			unix_socket = TRUE;
 #else
 		if (host_len == sizeof(".") - 1 && host[0] == '.') {
 			/* named pipe in socket */
-			if (!socket) {
-				socket = "\\\\.\\pipe\\MySQL";
+			if (!socket_or_pipe) {
+				socket_or_pipe = "\\\\.\\pipe\\MySQL";
 			}
-			transport_len = spprintf(&transport, 0, "pipe://%s", socket);
+			transport_len = spprintf(&transport, 0, "pipe://%s", socket_or_pipe);
 			named_pipe = TRUE;
 #endif
 		} else {
@@ -770,7 +770,7 @@
 				}
 			}
 		} else {
-			conn->unix_socket	= mnd_pestrdup(socket, conn->persistent);
+			conn->unix_socket	= mnd_pestrdup(socket_or_pipe, conn->persistent);
 			if (unix_socket) {
 				conn->host_info		= mnd_pestrdup("Localhost via UNIX socket", conn->persistent);
 			} else if (named_pipe) {
@@ -873,7 +873,7 @@
 						 const char *passwd, unsigned int passwd_len,
 						 const char *db, unsigned int db_len,
 						 unsigned int port,
-						 const char *socket,
+						 const char *socket_or_pipe,
 						 unsigned int mysql_flags
 						 TSRMLS_DC)
 {
@@ -891,7 +891,7 @@
 		}
 	}

-	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket, mysql_flags TSRMLS_CC);
+	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);

 	if (ret == FAIL) {
 		if (self_alloced) {

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.h	2010-10-05 16:26:18 UTC (rev 304111)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.h	2010-10-05 16:27:49 UTC (rev 304112)
@@ -102,7 +102,7 @@
 						  const char *passwd, unsigned int passwd_len,
 						  const char *db, unsigned int db_len,
 						  unsigned int port,
-						  const char *socket,
+						  const char *socket_or_pipe,
 						  unsigned int mysql_flags
 						  TSRMLS_DC);


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h	2010-10-05 16:26:18 UTC (rev 304111)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h	2010-10-05 16:27:49 UTC (rev 304112)
@@ -337,7 +337,7 @@


 typedef enum_func_status	(*func_mysqlnd_conn__init)(MYSQLND * conn TSRMLS_DC);
-typedef enum_func_status	(*func_mysqlnd_conn__connect)(MYSQLND *conn, const char *host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket, unsigned int mysql_flags TSRMLS_DC);
+typedef enum_func_status	(*func_mysqlnd_conn__connect)(MYSQLND *conn, const char *host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
 typedef ulong				(*func_mysqlnd_conn__escape_string)(const MYSQLND * const conn, char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_conn__set_charset)(MYSQLND * const conn, const char * const charset TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_conn__query)(MYSQLND *conn, const char *query, unsigned int query_len TSRMLS_DC);
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to