From a3f032602886ed40066373b40e1acf19b04c0fef Mon Sep 17 00:00:00 2001 From: Marco Paganini Date: Wed, 17 Mar 2021 19:42:07 -0700 Subject: [PATCH] Fix lack of 'extern' option for exitflag. In a debian system (either using cmake/make) or dpkg-buildpackage, linking will fail since exitflag is not declared as extern in the include file. This commit does so and initializes it in dsd_main.c as a global. --- include/dsd.h | 2 +- src/dsd_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dsd.h b/include/dsd.h index 22ef3e9b..353b8ded 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -61,7 +61,7 @@ /* * global variables */ -int exitflag; +extern int exitflag; typedef struct diff --git a/src/dsd_main.c b/src/dsd_main.c index 4069ce02..11042c6f 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -28,6 +28,7 @@ #include "p25p1_heuristics.h" #include "pa_devs.h" +int exitflag = 0; int comp (const void *a, const void *b) @@ -466,7 +467,6 @@ main (int argc, char **argv) initOpts (&opts); initState (&state); - exitflag = 0; signal (SIGINT, sigfun); while ((c = getopt (argc, argv, "haep:qstv:z:i:o:d:g:nw:B:C:R:f:m:u:x:A:S:M:rl")) != -1)