diff options
Diffstat (limited to 'src/dnsjit.c')
-rw-r--r-- | src/dnsjit.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/src/dnsjit.c b/src/dnsjit.c index 4d05d5f..20b8d14 100644 --- a/src/dnsjit.c +++ b/src/dnsjit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, OARC, Inc. + * Copyright (c) 2018-2024 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -27,52 +27,18 @@ #include <lualib.h> #include <lauxlib.h> -#include <pthread.h> -#include <signal.h> -#include <string.h> #include <stdio.h> -static void* _sighthr(void* arg) -{ - sigset_t* set = (sigset_t*)arg; - int sig = 0, err; - - if ((err = sigwait(set, &sig))) { - gldebug("sigwait %d", err); - } - glfatal("signal %d", sig); - - return 0; -} - int main(int argc, char* argv[]) { lua_State* L; int n, err; - sigset_t set; - pthread_t sighthr; if (argc < 2) { fprintf(stderr, "usage: %s <file.lua> ...\n", argv[0]); exit(1); } - sigfillset(&set); - if ((err = pthread_sigmask(SIG_BLOCK, &set, 0))) { - glfatal("Unable to set blocked signals with pthread_sigmask()"); - return 2; - } - - sigemptyset(&set); - sigaddset(&set, SIGTERM); - sigaddset(&set, SIGQUIT); - sigaddset(&set, SIGINT); - - if ((err = pthread_create(&sighthr, 0, _sighthr, &set))) { - glfatal("Unable to start signal thread with pthread_create()"); - return 2; - } - L = luaL_newstate(); luaL_openlibs(L); dnsjit_globals(L); |