# HG changeset patch # User jbe # Date 1497740786 -7200 # Node ID f9e8fbec20639baffe8b05773ba2db75e1e21cb3 # Parent 09d6428fdf6ced2402a4dc5486871fe743719efa Throw error when polling a collected child process diff -r 09d6428fdf6c -r f9e8fbec2063 moonbridge_io.c --- a/moonbridge_io.c Sun Jun 18 01:01:45 2017 +0200 +++ b/moonbridge_io.c Sun Jun 18 01:06:26 2017 +0200 @@ -1703,6 +1703,7 @@ } else { child = luaL_testudata(L, -2, MOONBR_IO_CHILD_MT_REGKEY); if (child) { + if (!child->pid) luaL_error(L, "Attemt to poll an already collected child process"); if (!check_sigchld) { check_sigchld = 1; moonbr_io_sigchld_flag = 0;