From 3247e7ed58db33b6f884c8a3390ec1911633c603 Mon Sep 17 00:00:00 2001 From: file Date: Tue, 12 Jun 2007 14:16:37 +0000 Subject: Even more minor code cleanup! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@68920 f38db490-d61c-443f-a65b-d21fe96a405b --- main/autoservice.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'main/autoservice.c') diff --git a/main/autoservice.c b/main/autoservice.c index 9ce49ac82..029555abd 100644 --- a/main/autoservice.c +++ b/main/autoservice.c @@ -65,8 +65,7 @@ static void *autoservice_run(void *ign) { for (;;) { - struct ast_channel *mons[MAX_AUTOMONS]; - struct ast_channel *chan; + struct ast_channel *mons[MAX_AUTOMONS], *chan; struct asent *as; int x = 0, ms = 500; @@ -81,15 +80,16 @@ static void *autoservice_run(void *ign) } AST_RWLIST_UNLOCK(&aslist); - chan = ast_waitfor_n(mons, x, &ms); - if (chan) { + if ((chan = ast_waitfor_n(mons, x, &ms))) { /* Read and ignore anything that occurs */ struct ast_frame *f = ast_read(chan); if (f) ast_frfree(f); } } + asthread = AST_PTHREADT_NULL; + return NULL; } @@ -151,5 +151,6 @@ int ast_autoservice_stop(struct ast_channel *chan) /* Wait for it to un-block */ while (ast_test_flag(chan, AST_FLAG_BLOCKING)) usleep(1000); + return res; } -- cgit v1.2.3