sd-event: fix missing needs_rearm

This commit is contained in:
Tom Gundersen 2014-08-15 18:21:18 +02:00
parent def9a7aa01
commit e07bbb7c50

View file

@ -894,6 +894,8 @@ _public_ int sd_event_add_time(
s->userdata = userdata; s->userdata = userdata;
s->enabled = SD_EVENT_ONESHOT; s->enabled = SD_EVENT_ONESHOT;
d->needs_rearm = true;
r = prioq_put(d->earliest, s, &s->time.earliest_index); r = prioq_put(d->earliest, s, &s->time.earliest_index);
if (r < 0) if (r < 0)
goto fail; goto fail;
@ -902,8 +904,6 @@ _public_ int sd_event_add_time(
if (r < 0) if (r < 0)
goto fail; goto fail;
d->needs_rearm = true;
if (ret) if (ret)
*ret = s; *ret = s;
@ -1872,6 +1872,7 @@ static int process_timer(
prioq_reshuffle(d->earliest, s, &s->time.earliest_index); prioq_reshuffle(d->earliest, s, &s->time.earliest_index);
prioq_reshuffle(d->latest, s, &s->time.latest_index); prioq_reshuffle(d->latest, s, &s->time.latest_index);
d->needs_rearm = true;
} }
return 0; return 0;