Skip to content

Commit

Permalink
Simplify test.c example, no need to stop timer before exit.
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Nilsson <[email protected]>
  • Loading branch information
troglobit committed Jan 11, 2015
1 parent 2a6697d commit 96a497b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ static uev_t *watchdog;

static void lifetime_cb(uev_ctx_t *ctx, uev_t UNUSED(*w), void *arg, int UNUSED(events))
{
fprintf(stderr, "\nLifetime exceeded %p\n", arg);
fprintf(stderr, "\nLifetime exceeded, program completed successfully! (arg:%p)\n", arg);
uev_exit(ctx);
}

/* The pipe watchdog, if it triggers we haven't received data in time. */
static void timeout_cb(uev_ctx_t *ctx, uev_t *w, void *arg, int UNUSED(events))
static void timeout_cb(uev_ctx_t *ctx, uev_t *UNUSED(w), void *arg, int UNUSED(events))
{
watchdog = NULL;
fprintf(stderr, "\nTimeout exceeded %p\n", arg);

uev_timer_stop(w);
// uev_timer_stop(w); <-- No need to stop timers with period=0 :)
uev_exit(ctx);
}

Expand Down

0 comments on commit 96a497b

Please sign in to comment.