summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Fischer <mfischer@php.net>2002-05-01 16:38:22 +0000
committerMarkus Fischer <mfischer@php.net>2002-05-01 16:38:22 +0000
commit07efbff8560d62d88c9ff0ee4be537115207a162 (patch)
tree3f2f15bd879314793ebff2dd831b5cacc8a34bf6
parentae5bc7c0f63b7d6f3cec72509e0b882734793146 (diff)
downloadphp-git-07efbff8560d62d88c9ff0ee4be537115207a162.tar.gz
- Update protos for socket_read() and socket_write().
- Set last_error in socket_write().
-rw-r--r--ext/sockets/sockets.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 9655be4326..e9222ce71b 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -696,7 +696,7 @@ PHP_FUNCTION(socket_close)
/* }}} */
/* {{{ proto int socket_write(resource socket, string buf[, int length])
- Writes the buffer to the file descriptor fd, length is optional */
+ Writes the buffer to the socket resource, length is optional */
PHP_FUNCTION(socket_write)
{
zval *arg1;
@@ -720,7 +720,7 @@ PHP_FUNCTION(socket_write)
#endif
if (retval < 0) {
- php_sock->error = errno;
+ SOCKETS_G(last_error) = php_sock->error = errno;
php_error(E_WARNING, "%s() unable to write to socket %d [%d]: %s", get_active_function_name(TSRMLS_C), php_sock->bsd_socket, errno, php_strerror(errno));
RETURN_FALSE;
}
@@ -732,7 +732,7 @@ PHP_FUNCTION(socket_write)
typedef int (*read_func)(int, void *, int);
/* {{{ proto string socket_read(resource socket, int length [, int type])
- Reads length bytes from socket */
+ Reads a maximum of length bytes from socket */
PHP_FUNCTION(socket_read)
{
zval *arg1;