romolo          Tue Mar 27 02:22:32 2001 EDT

  Modified files:              (Branch: PHP_4_0_5)
    /php4/ext/pgsql     pgsql.c 
  Log:
  
  pg_close was closing connection twice, pls insert in 4_0_5
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.93 php4/ext/pgsql/pgsql.c:1.93.2.1
--- php4/ext/pgsql/pgsql.c:1.93 Sun Feb 25 22:07:12 2001
+++ php4/ext/pgsql/pgsql.c      Tue Mar 27 02:22:32 2001
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: pgsql.c,v 1.93 2001/02/26 06:07:12 andi Exp $ */
+/* $Id: pgsql.c,v 1.93.2.1 2001/03/27 10:22:32 romolo Exp $ */
 
 #include <stdlib.h>
 
@@ -501,7 +501,8 @@
 PHP_FUNCTION(pg_close)
 {
        zval **pgsql_link = NULL;
-       int id;
+       void *ptr;
+       int id, type;
        PGconn *pgsql;
        PGLS_FETCH();
        
@@ -527,6 +528,10 @@
 
        if (id==-1) { /* explicit resource number */
                zend_list_delete(Z_RESVAL_PP(pgsql_link));
+               ptr = zend_list_find(Z_RESVAL_PP(pgsql_link),&type);
+               if (ptr && (type==le_link || type==le_plink)) {
+                       RETURN_TRUE;
+               }
        }
 
        if (id!=-1 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to