<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10883">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sched: Make sched_settime() return void because it cannot fail<br><br>Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5<br>---<br>M main/sched.c<br>1 file changed, 7 insertions(+), 13 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/83/10883/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/sched.c b/main/sched.c</span><br><span>index 0e7521e..e5a6e52 100644</span><br><span>--- a/main/sched.c</span><br><span>+++ b/main/sched.c</span><br><span>@@ -485,7 +485,7 @@</span><br><span> * given the last event *tv and the offset in milliseconds 'when',</span><br><span> * computes the next value,</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-static int sched_settime(struct timeval *t, int when)</span><br><span style="color: hsl(120, 100%, 40%);">+static void sched_settime(struct timeval *t, int when)</span><br><span> {</span><br><span> struct timeval now = ast_tvnow();</span><br><span> </span><br><span>@@ -507,7 +507,6 @@</span><br><span> if (ast_tvcmp(*t, now) < 0) {</span><br><span> *t = now;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span> }</span><br><span> </span><br><span> int ast_sched_replace_variable(int old_id, struct ast_sched_context *con, int when, ast_sched_cb callback, const void *data, int variable)</span><br><span>@@ -538,12 +537,10 @@</span><br><span> tmp->variable = variable;</span><br><span> tmp->when = ast_tv(0, 0);</span><br><span> tmp->deleted = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (sched_settime(&tmp->when, when)) {</span><br><span style="color: hsl(0, 100%, 40%);">- sched_release(con, tmp);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- schedule(con, tmp);</span><br><span style="color: hsl(0, 100%, 40%);">- res = tmp->sched_id->id;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ sched_settime(&tmp->when, when);</span><br><span style="color: hsl(120, 100%, 40%);">+ schedule(con, tmp);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = tmp->sched_id->id;</span><br><span> }</span><br><span> #ifdef DUMP_SCHEDULER</span><br><span> /* Dump contents of the context while we have the lock so nothing gets screwed up by accident. */</span><br><span>@@ -789,11 +786,8 @@</span><br><span> * If they return non-zero, we should schedule them to be</span><br><span> * run again.</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">- if (sched_settime(¤t->when, current->variable? res : current->resched)) {</span><br><span style="color: hsl(0, 100%, 40%);">- sched_release(con, current);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- schedule(con, current);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ sched_settime(¤t->when, current->variable ? res : current->resched);</span><br><span style="color: hsl(120, 100%, 40%);">+ schedule(con, current);</span><br><span> } else {</span><br><span> /* No longer needed, so release it */</span><br><span> sched_release(con, current);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10883">change 10883</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10883"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5 </div>
<div style="display:none"> Gerrit-Change-Number: 10883 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>