Re: cvs: php4 /ext/standard fsock.c
| From: | Andi Gutmans | Date: | Wed, 18 Oct 2000 20:24:26 +0000 |
| Subject: | Re: cvs: php4 /ext/standard fsock.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-2120@lists.php.net to get a copy of this message | ||
Your code is wrong. If you get parameters with the _ex API they are read-only. This means you can't change them because the zval's are reference counted and maybe some other variables are also pointing there.
You should probably move this function to the non-ex API.
Andi
At 01:41 PM 10/18/00 +0000, Stig Venaas wrote:
--- Andi Gutmans <andi@zend.com> http://www.zend.com/venaas Wed Oct 18 06:41:42 2000 EDTModified files:/php4/ext/standard fsock.cLog: Removed some zval_dtor calls. There were two more than needed, and I had just added two more... Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.53 php4/ext/standard/fsock.c:1.54--- php4/ext/standard/fsock.c:1.53 Wed Oct 18 06:21:08 2000+++ php4/ext/standard/fsock.c Wed Oct 18 06:41:42 2000 @@ -18,7 +18,7 @@+----------------------------------------------------------------------+*/ -/* $Id: fsock.c,v 1.53 2000/10/18 13:21:08 venaas Exp $ */ +/* $Id: fsock.c,v 1.54 2000/10/18 13:41:42 venaas Exp $ */ /* Synced with php 3.0 revision 1.121 1999-06-18 [ssb] */ /* Synced with php 3.0 revision 1.133 1999-07-21 [sas] */ @@ -288,11 +288,9 @@CLOSE_SOCK(1);if (arg_count>2) { - zval_dtor(*args[2]); ZVAL_LONG(*args[2],errno); } if (arg_count>3) { - zval_dtor(*args[3]); ZVAL_STRING(*args[3],strerror(errno),1); } RETURN_FALSE;@@ -314,11 +312,9 @@if (connect_nonb(socketd, (struct sockaddr *) &unix_addr, sizeof(unix_addr), &timeout) == SOCK_CONN_ERR) { CLOSE_SOCK(1); if(arg_count>2) { - zval_dtor(*args[2]); ZVAL_LONG(*args[2],errno); } if(arg_count>3) { - zval_dtor(*args[3]); ZVAL_STRING(*args[3],strerror(errno),1); } RETURN_FALSE;-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net For additional commands, e-mail: php-cvs-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net