Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed issue #114

  • Loading branch information...
commit 95381bf0be5c6fa5a5877364c472756aa6c75fc2 1 parent 8bc3810
Pieter Hintjens authored January 14, 2013

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  src/zloop.c
7  src/zloop.c
@@ -231,7 +231,7 @@ zloop_poller (zloop_t *self, zmq_pollitem_t *item, zloop_fn handler, void *arg)
231 231
 
232 232
     s_poller_t *poller = s_poller_new (item, handler, arg);
233 233
     if (poller) {
234  
-        if (zlist_push (self->pollers, poller))
  234
+        if (zlist_append (self->pollers, poller))
235 235
             return -1;
236 236
 
237 237
         self->dirty = true;
@@ -287,7 +287,7 @@ zloop_timer (zloop_t *self, size_t delay, size_t times, zloop_fn handler, void *
287 287
     s_timer_t *timer = s_timer_new (delay, times, handler, arg);
288 288
     if (!timer)
289 289
         return -1;
290  
-    if (zlist_push (self->timers, timer))
  290
+    if (zlist_append (self->timers, timer))
291 291
         return -1;
292 292
     if (self->verbose)
293 293
         zclock_log ("I: zloop: register timer delay=%d times=%d", delay, times);
@@ -330,7 +330,7 @@ zloop_set_verbose (zloop_t *self, bool verbose)
330 330
 //  Start the reactor. Takes control of the thread and returns when the 0MQ
331 331
 //  context is terminated or the process is interrupted, or any event handler
332 332
 //  returns -1. Event handlers may register new sockets and timers, and
333  
-//  cancel sockets. Returns 0 if interrupted, -1 if cancelled by a
  333
+//  cancel sockets. Returns 0 if interrupted, -1 if canceled by a
334 334
 //  handler, positive on internal error
335 335
 
336 336
 int
@@ -424,6 +424,7 @@ zloop_start (zloop_t *self)
424 424
                 if (timer->arg == arg) {
425 425
                     zlist_remove (self->timers, timer);
426 426
                     free (timer);
  427
+                    break;
427 428
                 }
428 429
                 timer = (s_timer_t *) zlist_next (self->timers);
429 430
             }

0 notes on commit 95381bf

Please sign in to comment.
Something went wrong with that request. Please try again.