From 96a497b03eb8b049a4810b77571bc512091944f3 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 11 Jan 2015 14:05:41 +0100 Subject: [PATCH] Simplify test.c example, no need to stop timer before exit. Signed-off-by: Joachim Nilsson --- test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test.c b/test.c index f7daf30..216ca9e 100644 --- a/test.c +++ b/test.c @@ -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); }