moonbridge
diff moonbridge_io.c @ 219:e53da349fd8f
Clarified nil/false return values of poll function and wait_nb method
author | jbe |
---|---|
date | Tue Jun 23 02:10:59 2015 +0200 (2015-06-23) |
parents | 35ea31e45b43 |
children | f4f6577742a1 |
line diff
1.1 --- a/moonbridge_io.c Tue Jun 23 02:07:26 2015 +0200 1.2 +++ b/moonbridge_io.c Tue Jun 23 02:10:59 2015 +0200 1.3 @@ -1464,7 +1464,9 @@ 1.4 } 1.5 } 1.6 if (!waitedpid) { 1.7 - lua_pushnil(L); 1.8 + lua_pushboolean(L, 0); 1.9 + lua_pushliteral(L, "Process is still running"); 1.10 + return 2; 1.11 } else { 1.12 child->pid = 0; 1.13 if (WIFEXITED(status)) { 1.14 @@ -1474,8 +1476,8 @@ 1.15 } else { 1.16 luaL_error(L, "Unexpected status value returned by waitpid call"); 1.17 } 1.18 + return 1; 1.19 } 1.20 - return 1; 1.21 } 1.22 1.23 static int moonbr_io_wait(lua_State *L) {