aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-10 18:26:07 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-10 20:09:09 +0100
commit89fa11af027139a1330717600bc962e69f6d5307 (patch)
treea1e1b035f7d8bf20473a024ce7c92f156a83896b /src/main.c
parent43b015a8ea7519ff9f821f5a9e0a3c63234121e1 (diff)
bsc: Remove the global link_set pointer from the bsc
Start removing the static names for the linkset
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 83eacbe..d3f80e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,6 +74,8 @@ static void sigint()
static pthread_mutex_t exit_mutex = PTHREAD_MUTEX_INITIALIZER;
static int handled = 0;
+ struct mtp_link_set *set;
+
/* failed to lock */
if (pthread_mutex_trylock(&exit_mutex) != 0)
return;
@@ -82,8 +84,11 @@ static void sigint()
printf("Terminating.\n");
handled = 1;
- if (bsc.setup)
- link_shutdown_all(bsc.link_set);
+ if (bsc.setup) {
+ llist_for_each_entry(set, &bsc.links, entry)
+ link_shutdown_all(set);
+ }
+
exit(0);
out:
@@ -167,6 +172,8 @@ static void bsc_msc_forward_init(struct bsc_data *bsc,
int main(int argc, char **argv)
{
int rc;
+ struct mtp_link_set *set;
+ INIT_LLIST_HEAD(&bsc.links);
bsc.app = APP_CELLMGR;
bsc.dpc = 1;
@@ -221,10 +228,13 @@ int main(int argc, char **argv)
if (rc < 0)
return rc;
- if (link_init(&bsc) != 0)
+ set = link_init(&bsc);
+ if (!set)
return -1;
- bsc.link_set->fw = &bsc.msc_forward;
- bsc.msc_forward.bsc = bsc.link_set;
+
+ llist_add(&set->entry, &bsc.links);
+ set->fw = &bsc.msc_forward;
+ bsc.msc_forward.bsc = set;
while (1) {
bsc_select_main(0);