]> git.e2factory.org Git - e2factory.git/commitdiff
le2lib: return errno value from poll
authorTobias Ulmer <tu@emlix.com>
Mon, 11 Feb 2019 17:58:01 +0000 (18:58 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 11 Feb 2019 17:58:01 +0000 (18:58 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/le2lib.c

index fb2b38170372adaff64c3b64a9a32ed523d16e67..7834ed723a00abe016f246c3723a5c12656027c4 100644 (file)
@@ -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