aboutsummaryrefslogtreecommitdiffstats
path: root/sched.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-06 15:55:15 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-06 15:55:15 +0000
commit3ccdfaa009a2bc8f21f7c0e1c6e85064173eaf2d (patch)
tree7d03f417dcc16480c498594ee6278ba8c58f465d /sched.c
parent25108e6dfbe08fe0b1deb1668f5fcb6eadcbbecc (diff)
minor code cleanup
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17867 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'sched.c')
-rw-r--r--sched.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sched.c b/sched.c
index effd6d810..56a16bde4 100644
--- a/sched.c
+++ b/sched.c
@@ -391,15 +391,14 @@ long ast_sched_when(struct sched_context *con,int id)
DEBUG(ast_log(LOG_DEBUG, "ast_sched_when()\n"));
ast_mutex_lock(&con->lock);
- s=con->schedq;
- while (s!=NULL) {
- if (s->id==id) break;
- s=s->next;
+ for (s = con->schedq; s; s = s->next) {
+ if (s->id == id)
+ break;
}
secs=-1;
if (s!=NULL) {
struct timeval now = ast_tvnow();
- secs=s->when.tv_sec-now.tv_sec;
+ secs = s->when.tv_sec - now.tv_sec;
}
ast_mutex_unlock(&con->lock);
return secs;