chiark / gitweb /
cleanup: move declaration of version[] into secnet.h
[secnet.git] / secnet.c
index bef236dda9a2b466fad8636e7d51749b7eaaa5e6..16fa198161d414e3071842eb98f283ac7d8c2dbc 100644 (file)
--- a/secnet.c
+++ b/secnet.c
@@ -1,5 +1,3 @@
-extern char version[];
-
 #include "secnet.h"
 #include <stdio.h>
 #include <string.h>
@@ -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)