Skip to content
Snippets Groups Projects
Commit 85548ccc authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

minor code cleanup


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent e9b428e1
Branches
Tags
No related merge requests found
...@@ -391,15 +391,14 @@ long ast_sched_when(struct sched_context *con,int id) ...@@ -391,15 +391,14 @@ long ast_sched_when(struct sched_context *con,int id)
DEBUG(ast_log(LOG_DEBUG, "ast_sched_when()\n")); DEBUG(ast_log(LOG_DEBUG, "ast_sched_when()\n"));
ast_mutex_lock(&con->lock); ast_mutex_lock(&con->lock);
s=con->schedq; for (s = con->schedq; s; s = s->next) {
while (s!=NULL) { if (s->id == id)
if (s->id==id) break; break;
s=s->next;
} }
secs=-1; secs=-1;
if (s!=NULL) { if (s!=NULL) {
struct timeval now = ast_tvnow(); 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); ast_mutex_unlock(&con->lock);
return secs; return secs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment