isisd: fix --enable-isis-topology for 64-bit Linux
[jleu-quagga.git] / tests / test-sig.c
blob63aab6f0b46a9477b0b5cc9c898e44a827b22a21
1 #include <zebra.h>
2 #include <sigevent.h>
3 #include "lib/log.h"
5 void
6 sighup (void)
8 printf ("processed hup\n");
11 void
12 sigusr1 (void)
14 printf ("processed usr1\n");
17 void
18 sigusr2 (void)
20 printf ("processed usr2\n");
23 struct quagga_signal_t sigs[] =
26 .signal = SIGHUP,
27 .handler = &sighup,
30 .signal = SIGUSR1,
31 .handler = &sigusr1,
34 .signal = SIGUSR2,
35 .handler = &sigusr2,
39 struct thread_master *master;
40 struct thread t;
42 int
43 main (void)
45 master = thread_master_create ();
46 signal_init (master, Q_SIGC(sigs), sigs);
48 zlog_default = openzlog("testsig", ZLOG_NONE,
49 LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);
50 zlog_set_level (NULL, ZLOG_DEST_SYSLOG, ZLOG_DISABLED);
51 zlog_set_level (NULL, ZLOG_DEST_STDOUT, LOG_DEBUG);
52 zlog_set_level (NULL, ZLOG_DEST_MONITOR, ZLOG_DISABLED);
54 while (thread_fetch (master, &t))
55 thread_call (&t);
57 exit (0);