X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/fe5e9cc422cd72526ccfceffbc7e5af8ac83b407..27f5042b0435d26ae98b22f8e42115e44afe53bc:/secnet.c diff --git a/secnet.c b/secnet.c index bef236d..16fa198 100644 --- a/secnet.c +++ b/secnet.c @@ -1,5 +1,3 @@ -extern char version[]; - #include "secnet.h" #include #include @@ -27,14 +25,6 @@ cstring_t require_root_privileges_explanation=NULL; static pid_t secnet_pid; -/* from log.c */ -extern uint32_t message_level; -extern bool_t secnet_is_daemon; -extern struct log_if *system_log; - -/* from process.c */ -extern void start_signal_handling(void); - /* Structures dealing with poll() call */ struct poll_interest { beforepoll_fn *before; @@ -263,10 +253,7 @@ static void run(void) int timeout; struct pollfd *fds; - fds=alloca(sizeof(*fds)*total_nfds); - if (!fds) { - fatal("run: couldn't alloca"); - } + fds=safe_malloc(sizeof(*fds)*total_nfds, "run"); Message(M_NOTICE,"%s [%d]: starting\n",version,secnet_pid); @@ -309,6 +296,7 @@ static void run(void) } } while (rv<0); } while (!finished); + free(fds); } static void droppriv(void)