Skip to content

Commit

Permalink
switch libuv version to stable version. #40
Browse files Browse the repository at this point in the history
  • Loading branch information
chobie committed Feb 28, 2013
1 parent 0c9e917 commit aa399f2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
Expand Down
2 changes: 1 addition & 1 deletion libuv
Submodule libuv updated 333 files
6 changes: 3 additions & 3 deletions php_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
/* }}} */

Expand All @@ -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));
}
/* }}} */

Expand Down
21 changes: 21 additions & 0 deletions tests/330-poll.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
Check for fs read and close
--FILE--
<?php
$fd = fopen("testfile","w+");

$poll = uv_poll_init(uv_default_loop(), $fd);
uv_poll_start($poll, UV::WRITABLE, function($poll, $stat, $ev, $conn){
fwrite($conn, "Hello");
fclose($conn);
$data = file_get_contents("testfile");
if ($data == "Hello") {
echo "OK";
}
unlink("testfile");
uv_poll_stop($poll);
});

uv_run();
--EXPECT--
OK

0 comments on commit aa399f2

Please sign in to comment.