From: Tobias Ulmer Date: Mon, 11 Feb 2019 17:58:01 +0000 (+0100) Subject: le2lib: return errno value from poll X-Git-Tag: e2factory-2.3.18rc1~61 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=fbcb9d7d3823491cea2888b6d21ca8da3c28b79d;p=e2factory.git le2lib: return errno value from poll Signed-off-by: Tobias Ulmer --- diff --git a/generic/le2lib.c b/generic/le2lib.c index fb2b381..7834ed7 100644 --- a/generic/le2lib.c +++ b/generic/le2lib.c @@ -330,10 +330,12 @@ poll_fd(lua_State *lua) } f = poll(fds, nfds, tmo); if (f < 0) { + int e = errno; lua_pushboolean(lua, 0); - lua_pushstring(lua, strerror(errno)); + lua_pushstring(lua, strerror(e)); + lua_pushinteger(lua, e); free(fds); - return 2; + return 3; } /* We want to return a table containing all selected fds looking like