process: call poll_process when getting returncode

This commit is contained in:
takase1121
2024-12-05 22:18:39 +08:00
parent f87617f829
commit 2f208d452f
+1 -1
View File
@@ -697,7 +697,7 @@ static int f_pid(lua_State* L) {
static int f_returncode(lua_State *L) {
process_t* self = (process_t*) luaL_checkudata(L, 1, API_TYPE_PROCESS);
if (self->running)
if (poll_process(self, WAIT_NONE))
return 0;
lua_pushinteger(L, self->returncode);
return 1;