summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2001-06-03 21:38:23 +0000
committerSterling Hughes <sterling@php.net>2001-06-03 21:38:23 +0000
commitd892b34a3680ac8d560bce697940ad0512496fbc (patch)
tree88308e48640f94bde8efc5120eb70488633ec67c /ext
parent75720b018eaba3d41dd0710d558988b883d998ff (diff)
downloadphp-git-d892b34a3680ac8d560bce697940ad0512496fbc.tar.gz
fix this (mea culpa, stray commit)
Diffstat (limited to 'ext')
-rw-r--r--ext/sockets/sockets.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index c8a1509e46..c3c21be6ff 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -187,7 +187,8 @@ static void destroy_iovec(zend_rsrc_list_entry *rsrc)
}
}
-static void destroy_socket(zend_rsrc_list_entry *rsrc) {
+static void destroy_socket(zend_rsrc_list_entry *rsrc)
+{
php_socket *php_sock = (php_socket*)rsrc->ptr;
close(php_sock->socket);
@@ -367,9 +368,13 @@ PHP_MINFO_FUNCTION(sockets)
Allocates a new file descriptor set */
PHP_FUNCTION(socket_fd_alloc)
{
- fd_set set;
- FD_ZERO(&set);
- ZEND_REGISTER_RESOURCE(return_value, &set, le_destroy);
+ fd_set *set;
+
+ set = emalloc(sizeof *set);
+
+ FD_ZERO(set);
+
+ ZEND_REGISTER_RESOURCE(return_value, set, le_destroy);
}
/* }}} */