]>
Commit | Line | Data |
---|---|---|
4d474fa3 DL |
1 | /* |
2 | * SEGV / backtrace handling test. | |
3 | * | |
4 | * copied from test-sig.c | |
5 | * | |
6 | * Copyright (C) 2013 by David Lamparter, Open Source Routing. | |
7 | * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC") | |
8 | * | |
9 | * This file is part of Quagga | |
10 | * | |
11 | * Quagga is free software; you can redistribute it and/or modify it | |
12 | * under the terms of the GNU General Public License as published by the | |
13 | * Free Software Foundation; either version 2, or (at your option) any | |
14 | * later version. | |
15 | * | |
16 | * Quagga is distributed in the hope that it will be useful, but | |
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 | * General Public License for more details. | |
20 | * | |
896014f4 DL |
21 | * You should have received a copy of the GNU General Public License along |
22 | * with this program; see the file COPYING; if not, write to the Free Software | |
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
4d474fa3 DL |
24 | */ |
25 | ||
26 | #include <zebra.h> | |
27 | #include <sigevent.h> | |
28 | #include "lib/log.h" | |
29 | #include "lib/memory.h" | |
30 | ||
d62a17ae | 31 | struct quagga_signal_t sigs[] = {}; |
4d474fa3 DL |
32 | |
33 | struct thread_master *master; | |
34 | ||
d62a17ae | 35 | static int threadfunc(struct thread *thread) |
4d474fa3 | 36 | { |
d62a17ae | 37 | int *null = NULL; |
38 | *null += 1; | |
39 | return 0; | |
4d474fa3 DL |
40 | } |
41 | ||
d62a17ae | 42 | int main(void) |
4d474fa3 | 43 | { |
d62a17ae | 44 | master = thread_master_create(NULL); |
45 | signal_init(master, array_size(sigs), sigs); | |
4d474fa3 | 46 | |
d62a17ae | 47 | openzlog("testsegv", "NONE", 0, LOG_CONS | LOG_NDELAY | LOG_PID, |
48 | LOG_DAEMON); | |
49 | zlog_set_level(ZLOG_DEST_SYSLOG, ZLOG_DISABLED); | |
50 | zlog_set_level(ZLOG_DEST_STDOUT, LOG_DEBUG); | |
51 | zlog_set_level(ZLOG_DEST_MONITOR, ZLOG_DISABLED); | |
4d474fa3 | 52 | |
d62a17ae | 53 | thread_execute(master, threadfunc, 0, 0); |
4d474fa3 | 54 | |
d62a17ae | 55 | exit(0); |
4d474fa3 | 56 | } |