CVS update: php31/ext/mysql

From: Date: Sat, 22 Aug 1998 15:21:28 +0000
Subject: CVS update: php31/ext/mysql
Groups: php.dev 
Request: Send a blank email to php-dev+get-480@lists.php.net to get a copy of this message
Date: Saturday August 22, 1998 @ 11:21 Author: zeev Update of /repository/php31/ext/mysql In directory asf:/tmp/cvs-serv16724/ext/mysql Modified Files: mysql.c Log Message: We only want this under UNIX Index: php31/ext/mysql/mysql.c diff -c php31/ext/mysql/mysql.c:2.4 php31/ext/mysql/mysql.c:2.5 *** php31/ext/mysql/mysql.c:2.4 Sat Aug 22 11:08:01 1998 --- php31/ext/mysql/mysql.c Sat Aug 22 11:21:27 1998 *************** *** 27,33 **** +----------------------------------------------------------------------+ */ ! /* $Id: mysql.c,v 2.4 1998/08/22 15:08:01 rasmus Exp $ */ /* TODO: --- 27,33 ---- +----------------------------------------------------------------------+ */ ! /* $Id: mysql.c,v 2.5 1998/08/22 15:21:27 zeev Exp $ */ /* TODO: *************** *** 80,85 **** --- 80,91 ---- #define SAFE_STRING(s) ((s)?(s):"") + #if WIN32|WINNT + # define SIGNAL(s, h) NULL + #else + # define SIGNAL(s, h) signal(s, h) + #endif + function_entry mysql_functions[] = { {"mysql_connect", php3_mysql_connect, NULL}, {"mysql_pconnect", php3_mysql_pconnect, NULL}, *************** *** 175,183 **** void (*handler) (int); MySQL_TLS_VARS; ! handler = signal(SIGPIPE, SIG_IGN); /* Just to be safe */ mysql_close(link); ! signal(SIGPIPE,handler); efree(link); MySQL_GLOBAL(php3_mysql_module).num_links--; } --- 181,189 ---- void (*handler) (int); MySQL_TLS_VARS; ! handler = SIGNAL(SIGPIPE, SIG_IGN); /* Just to be safe */ mysql_close(link); ! SIGNAL(SIGPIPE,handler); efree(link); MySQL_GLOBAL(php3_mysql_module).num_links--; } *************** *** 187,195 **** void (*handler) (int); MySQL_TLS_VARS; ! handler = signal(SIGPIPE, SIG_IGN); /* Just to be safe */ mysql_close(link); ! signal(SIGPIPE,handler); free(link); MySQL_GLOBAL(php3_mysql_module).num_persistent--; --- 193,201 ---- void (*handler) (int); MySQL_TLS_VARS; ! handler = SIGNAL(SIGPIPE, SIG_IGN); /* Just to be safe */ mysql_close(link); ! SIGNAL(SIGPIPE,handler); free(link); MySQL_GLOBAL(php3_mysql_module).num_persistent--; *************** *** 450,463 **** RETURN_FALSE; } /* ensure that the link did not die */ ! handler = signal(SIGPIPE,SIG_IGN); #if defined(mysql_errno) && defined(CR_SERVER_GONE_ERROR) mysql_stat(le->ptr); if (mysql_errno((MYSQL *)le->ptr) == CR_SERVER_GONE_ERROR) { #else if (!strcasecmp(mysql_stat(le->ptr),"mysql server has gone away")) { /* the link died */ #endif ! signal(SIGPIPE,handler); if (mysql_connect(le->ptr,host,user,passwd)==NULL) { php3_error(E_WARNING,"MySQL: Link to server lost, unable to reconnect"); _php3_hash_del(plist, hashed_details, hashed_details_length+1); --- 456,469 ---- RETURN_FALSE; } /* ensure that the link did not die */ ! handler = SIGNAL(SIGPIPE,SIG_IGN); #if defined(mysql_errno) && defined(CR_SERVER_GONE_ERROR) mysql_stat(le->ptr); if (mysql_errno((MYSQL *)le->ptr) == CR_SERVER_GONE_ERROR) { #else if (!strcasecmp(mysql_stat(le->ptr),"mysql server has gone away")) { /* the link died */ #endif ! SIGNAL(SIGPIPE,handler); if (mysql_connect(le->ptr,host,user,passwd)==NULL) { php3_error(E_WARNING,"MySQL: Link to server lost, unable to reconnect"); _php3_hash_del(plist, hashed_details, hashed_details_length+1); *************** *** 465,471 **** RETURN_FALSE; } } ! signal(SIGPIPE,handler); mysql = (MYSQL *) le->ptr; } return_value->value.lval = php3_list_insert(mysql,MySQL_GLOBAL(php3_mysql_module).le_plink); --- 471,477 ---- RETURN_FALSE; } } ! SIGNAL(SIGPIPE,handler); mysql = (MYSQL *) le->ptr; } return_value->value.lval = php3_list_insert(mysql,MySQL_GLOBAL(php3_mysql_module).le_plink); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#480) next »