aboutsummaryrefslogtreecommitdiffstats
path: root/main/autoservice.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-12 14:16:37 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-12 14:16:37 +0000
commit3247e7ed58db33b6f884c8a3390ec1911633c603 (patch)
tree6866b9f3260de4c55530d07267dff67365d79b1a /main/autoservice.c
parent714aae1e9bfd27b37b05a2cdbd202b681e7de6d5 (diff)
Even more minor code cleanup!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@68920 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/autoservice.c')
-rw-r--r--main/autoservice.c9
1 files changed, 5 insertions, 4 deletions
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;
}