<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10884">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Corey Farrell: Looks good to me, but someone else must approve
Matthew Fredrickson: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><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;"><span>diff --git a/main/sched.c b/main/sched.c</span><br><span>index 848b4c2..d141e70 100644</span><br><span>--- a/main/sched.c</span><br><span>+++ b/main/sched.c</span><br><span>@@ -483,7 +483,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>@@ -505,7 +505,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>@@ -536,12 +535,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>@@ -787,11 +784,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/10884">change 10884</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/10884"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5 </div>
<div style="display:none"> Gerrit-Change-Number: 10884 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Matthew Fredrickson <creslin@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>