luci-lib-nixio: fix compilation

Fixes: #2921
Fixes: f3f42ff09 ("address: Replace ualarm with setitimer")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-07-26 15:11:17 +02:00
parent 2a1a60740a
commit 16f23de977

View file

@ -288,9 +288,9 @@ static int nixio_getnameinfo(lua_State *L) {
const char *family = luaL_optstring(L, 2, NULL);
#ifdef __linux__
const struct itimerval t = { {timeout * 1000 * 1000, 0} , {0, 0} };
struct sigaction sa_new, sa_old;
int timeout = luaL_optnumber(L, 3, 0);
const struct itimerval t = { {timeout * 1000 * 1000, 0} , {0, 0} };
if (timeout > 0 && timeout < 1000)
{
sa_new.sa_handler = nixio__handle_alarm;