From a66b053ac96d188b08651b3d0bb66dd484fe516a Mon Sep 17 00:00:00 2001 From: foobar Date: Mon, 14 Feb 2005 22:16:06 +0000 Subject: [PATCH] - Removed duplicate error + reset error in new sockets --- ext/sockets/sockets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index c42b5ee5dc6..a242382af48 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -663,6 +663,8 @@ PHP_FUNCTION(socket_create_listen) RETURN_FALSE; } + php_sock->error = 0; + ZEND_REGISTER_RESOURCE(return_value, php_sock, le_socket); } /* }}} */ @@ -681,9 +683,10 @@ PHP_FUNCTION(socket_accept) ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr *) &sa TSRMLS_CC)) { - PHP_SOCKET_ERROR(new_sock, "unable to accept socket connection", errno); RETURN_FALSE; } + + new_sock->error = 0; ZEND_REGISTER_RESOURCE(return_value, new_sock, le_socket); }