From 03c70a8d81f14ce46bc3410b08f5956d6af34d82 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Jun 2015 21:08:55 +0200 Subject: subprocess, lua: export whether the process was killed by us We want to distinguish actual errors, and just aborting the program intentionally. Also be a bit more careful with handling the wait() exit status: do not called WEXITSTATUS() without checking WIFEXITED() first. --- player/lua.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'player/lua.c') diff --git a/player/lua.c b/player/lua.c index f640b654cf..5a16c9202a 100644 --- a/player/lua.c +++ b/player/lua.c @@ -1243,6 +1243,8 @@ static int script_subprocess(lua_State *L) lua_setfield(L, -2, "status"); // res lua_pushlstring(L, cb_ctx.output.start, cb_ctx.output.len); // res d lua_setfield(L, -2, "stdout"); // res + lua_pushboolean(L, status == MP_SUBPROCESS_EKILLED_BY_US); // res b + lua_setfield(L, -2, "killed_by_us"); // res return 1; } -- cgit v1.2.3