summaryrefslogtreecommitdiff
path: root/accel-pptpd/triton/triton.c
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-08-31 18:21:14 +0400
committerKozlov Dmitry <dima@server>2010-08-31 18:21:14 +0400
commit5bac5a2edb7bc7639c853fd0f7109dcddb7c4cee (patch)
tree14d1d6178e14e096dd7341eb33c3e73b02f0fd0c /accel-pptpd/triton/triton.c
parent55ebaec066819d068bf13a42998ebc3f31377990 (diff)
downloadaccel-ppp-5bac5a2edb7bc7639c853fd0f7109dcddb7c4cee.tar.gz
accel-ppp-5bac5a2edb7bc7639c853fd0f7109dcddb7c4cee.zip
rewriting triton library...
Diffstat (limited to 'accel-pptpd/triton/triton.c')
-rw-r--r--accel-pptpd/triton/triton.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/accel-pptpd/triton/triton.c b/accel-pptpd/triton/triton.c
index 25759b58..23a69c60 100644
--- a/accel-pptpd/triton/triton.c
+++ b/accel-pptpd/triton/triton.c
@@ -45,6 +45,9 @@ cont:
list_for_each_entry(h,&thread->ctx->handlers,entry)
if (h->close)
h->close(h);
+ list_for_each_entry(t,&thread->ctx->timers,entry)
+ if (t->close)
+ t->close(t);
thread->ctx->close=0;
}
@@ -156,10 +159,20 @@ void triton_unregister_ctx(struct triton_ctx_t *ctx)
spin_unlock(&ctx_list_lock);
}
-void triton_init()
+int triton_init()
{
- md_init();
- timer_init();
+ default_ctx=malloc(sizeof(*default_ctx));
+ if (!default_ctx)
+ {
+ fprintf(stderr,"cann't allocate memory\n");
+ return -1;
+ }
+ triton_register_ctx(default_ctx);
+
+ if (md_init())
+ return -1;
+ if (timer_init())
+ return -1;
}
void triton_run()