projects
/
lcr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed wrong reference when requesting a channel from chan_lcr.
[lcr.git]
/
main.c
diff --git
a/main.c
b/main.c
index
98be1c0
..
6eb2b68
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-10,7
+10,15
@@
\*****************************************************************************/
#include "main.h"
\*****************************************************************************/
#include "main.h"
+#ifdef PACKAGE_VERSION
+#undef PACKAGE_VERSION
+#endif
#include "config.h"
#include "config.h"
+#ifdef WITH_GSM_MS
+extern "C" {
+#include <osmocom/core/signal.h>
+}
+#endif
//MESSAGES
//MESSAGES
@@
-138,11
+146,23
@@
void _printerror(const char *function, int line, const char *fmt, ...)
void sighandler(int sigset)
{
struct sched_param schedp;
void sighandler(int sigset)
{
struct sched_param schedp;
+#ifdef WITH_GSM_MS
+ int wait_ms = 0;
+#endif
if (sigset == SIGHUP)
return;
if (sigset == SIGPIPE)
return;
if (sigset == SIGHUP)
return;
if (sigset == SIGPIPE)
return;
+ fprintf(stderr, "LCR: Signal received: %d\n", sigset);
+ PDEBUG(DEBUG_LOG, "Signal received: %d\n", sigset);
+#ifdef WITH_GSM_MS
+ if (!wait_ms) {
+ wait_ms = 1;
+ osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
+ return;
+ }
+#endif
if (!quit) {
quit = sigset;
/* set scheduler & priority */
if (!quit) {
quit = sigset;
/* set scheduler & priority */
@@
-151,8
+171,6
@@
void sighandler(int sigset)
schedp.sched_priority = 0;
sched_setscheduler(0, SCHED_OTHER, &schedp);
}
schedp.sched_priority = 0;
sched_setscheduler(0, SCHED_OTHER, &schedp);
}
- fprintf(stderr, "LCR: Signal received: %d\n", sigset);
- PDEBUG(DEBUG_LOG, "Signal received: %d\n", sigset);
}
}
}
}
@@
-364,7
+382,7
@@
int main(int argc, char *argv[])
}
#if defined WITH_GSM_BS || defined WITH_GSM_MS
}
#if defined WITH_GSM_BS || defined WITH_GSM_MS
- /*
handle
gsm */
+ /*
init
gsm */
if (options.gsm && gsm_init()) {
fprintf(stderr, "GSM initialization failed.\n");
goto free;
if (options.gsm && gsm_init()) {
fprintf(stderr, "GSM initialization failed.\n");
goto free;
@@
-469,12
+487,8
@@
int main(int argc, char *argv[])
if (options.gsm) {
if (handle_gsm())
all_idle = 0;
if (options.gsm) {
if (handle_gsm())
all_idle = 0;
-#ifdef WITH_GSM_BS
- if (handle_gsm_bs())
- all_idle = 0;
-#endif
#ifdef WITH_GSM_MS
#ifdef WITH_GSM_MS
- if (handle_gsm_ms())
+ if (handle_gsm_ms(
&quit
))
all_idle = 0;
#endif
}
all_idle = 0;
#endif
}
@@
-602,6
+616,10
@@
free:
#endif
}
#endif
}
+ /* close loopback, if used by GSM or remote */
+ if (mISDNloop.sock > -1)
+ mISDNloop_close();
+
/* display memory leak */
#define MEMCHECK(a, b) \
if (b) { \
/* display memory leak */
#define MEMCHECK(a, b) \
if (b) { \