# HG changeset patch # User jbe # Date 1428284490 -7200 # Node ID 069ee3f5ab1745d40e1d007ddaebc0cc18d72fc4 # Parent e1aec772a6ab82659e5d21eee6338de625b53497 Non-blocking write methods shall return io handle diff -r e1aec772a6ab -r 069ee3f5ab17 moonbridge_io.c --- a/moonbridge_io.c Mon Apr 06 03:36:37 2015 +0200 +++ b/moonbridge_io.c Mon Apr 06 03:41:30 2015 +0200 @@ -170,10 +170,11 @@ } } handle->writebufcnt = 0; - lua_pushinteger(L, 0); + if (nonblocking) lua_pushinteger(L, 0); } else { - lua_pushinteger(L, handle->writeleft - handle->writebufcnt); + if (nonblocking) lua_pushinteger(L, handle->writeleft - handle->writebufcnt); } + if (!nonblocking) lua_pushvalue(L, 1); return 1; moonbr_io_write_impl_block: if (flush) lua_pushinteger(L, handle->writeleft);