From fbcb9d7d3823491cea2888b6d21ca8da3c28b79d Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Mon, 11 Feb 2019 18:58:01 +0100 Subject: [PATCH] le2lib: return errno value from poll Signed-off-by: Tobias Ulmer --- generic/le2lib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.39.5