]>
git.proxmox.com Git - mirror_frr.git/blob - tests/lib/test_sig.c
2 * This file is part of Quagga.
4 * Quagga is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
9 * Quagga is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Quagga; see the file COPYING. If not, write to the Free
16 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 #include "lib/memory.h"
25 static void sighup(void)
27 printf("processed hup\n");
30 static void sigusr1(void)
32 printf("processed usr1\n");
35 static void sigusr2(void)
37 printf("processed usr2\n");
40 struct quagga_signal_t sigs
[] = {{
53 struct thread_master
*master
;
58 master
= thread_master_create();
59 signal_init(master
, array_size(sigs
), sigs
);
61 openzlog("testsig", "NONE", 0, LOG_CONS
| LOG_NDELAY
| LOG_PID
,
63 zlog_set_level(ZLOG_DEST_SYSLOG
, ZLOG_DISABLED
);
64 zlog_set_level(ZLOG_DEST_STDOUT
, LOG_DEBUG
);
65 zlog_set_level(ZLOG_DEST_MONITOR
, ZLOG_DISABLED
);
67 while (thread_fetch(master
, &t
))