From aa399f2487d52b979f93696c04fc88f0a68621d1 Mon Sep 17 00:00:00 2001 From: Shuhei Tanuma Date: Thu, 28 Feb 2013 21:42:53 +0900 Subject: [PATCH] switch libuv version to stable version. #40 --- config.m4 | 2 +- libuv | 2 +- php_uv.c | 6 +++--- tests/330-poll.phpt | 21 +++++++++++++++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 tests/330-poll.phpt diff --git a/config.m4 b/config.m4 index 61f9b77..35f78c9 100644 --- a/config.m4 +++ b/config.m4 @@ -56,7 +56,7 @@ if test $PHP_UV != "no"; then fi PHP_ADD_INCLUDE([$ext_srcdir/libuv/include]) - CFLAGS=" $CFLAGS -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -Wl,libuv/libuv.a" + CFLAGS=" $CFLAGS -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -Wl,libuv/uv.a" case $host in *darwin*) diff --git a/libuv b/libuv index e4d8cba..86ae8b3 160000 --- a/libuv +++ b/libuv @@ -1 +1 @@ -Subproject commit e4d8cbac7875449a6c4cf65d98d621738fbc21e6 +Subproject commit 86ae8b3c639bef040625dba03d842298746ca01b diff --git a/php_uv.c b/php_uv.c index cf91b43..0ec6cc2 100644 --- a/php_uv.c +++ b/php_uv.c @@ -1715,7 +1715,7 @@ static void php_uv_fs_cb(uv_fs_t* req) case UV_FS_STAT: { zval *buffer; - if (req && req->ptr) { + if (Z_LVAL_P(result) >= 0) { buffer = php_uv_make_stat((const uv_statbuf_t*)req->ptr); } else { MAKE_STD_ZVAL(buffer); @@ -3350,7 +3350,7 @@ PHP_FUNCTION(uv_run) } PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop); //TODO: implement this - uv_run(loop, UV_RUN_DEFAULT); + uv_run(loop); } /* }}} */ @@ -3367,7 +3367,7 @@ PHP_FUNCTION(uv_run_once) } PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop); - RETURN_LONG(uv_run(loop, UV_RUN_ONCE)); + RETURN_LONG(uv_run_once(loop)); } /* }}} */ diff --git a/tests/330-poll.phpt b/tests/330-poll.phpt new file mode 100644 index 0000000..c352e0c --- /dev/null +++ b/tests/330-poll.phpt @@ -0,0 +1,21 @@ +--TEST-- +Check for fs read and close +--FILE-- +