move signal_setup() to main.c
authorFelix Fietkau <nbd@openwrt.org>
Mon, 9 Jun 2014 22:00:08 +0000 (00:00 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 9 Jun 2014 22:00:08 +0000 (00:00 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
main.c
util.c
util.h

diff --git a/main.c b/main.c
index 115bd2a018afcc33fcefff0f5c1460ca60b166df..8275c4861d576590aeb53a3c3a083f84de55b1da 100644 (file)
--- a/main.c
+++ b/main.c
 
 static char *iface_name = "eth0";
 
+static void
+signal_shutdown(int signal)
+{
+       uloop_end();
+}
+
 int
 main(int argc, char **argv)
 {
@@ -73,7 +79,9 @@ main(int argc, char **argv)
                return -1;
        }
 
-       signal_setup();
+       signal(SIGPIPE, SIG_IGN);
+       signal(SIGTERM, signal_shutdown);
+       signal(SIGKILL, signal_shutdown);
 
        if (cache_init())
                return -1;
diff --git a/util.c b/util.c
index 05f02b2061181e03c167aa3737b8fbd8d797c091..e68e9c9f5f0e27cbbc2f02382698475bb867dff0 100644 (file)
--- a/util.c
+++ b/util.c
@@ -39,20 +39,6 @@ int debug = 0;
 char mdns_hostname[HOSTNAME_LEN];
 char mdns_hostname_local[HOSTNAME_LEN + 6];
 
-static void
-signal_shutdown(int signal)
-{
-       uloop_end();
-}
-
-void
-signal_setup(void)
-{
-       signal(SIGPIPE, SIG_IGN);
-       signal(SIGTERM, signal_shutdown);
-       signal(SIGKILL, signal_shutdown);
-}
-
 uint32_t
 rand_time_delta(uint32_t t)
 {
diff --git a/util.h b/util.h
index ab38b7a0fbb43037c6a03cdc5d54602f15995170..aaa2bd1fed1a11be9f6dfb3f0f58d9f07fbebf0e 100644 (file)
--- a/util.h
+++ b/util.h
@@ -31,7 +31,6 @@ extern char mdns_hostname_local[HOSTNAME_LEN + 6];
 
 void *memdup(const void *d, int l);
 
-extern void signal_setup(void);
 extern void get_hostname(void);
 extern uint32_t rand_time_delta(uint32_t t);