From de79609550c63f74d74d66d5c37c584b4e8ef127 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 27 Sep 2018 14:42:43 +0200 Subject: [PATCH] lib: Use timeout name in debug messages when available --- libfprint/fpi-poll.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libfprint/fpi-poll.c b/libfprint/fpi-poll.c index 323774fb..6d3dd3f9 100644 --- a/libfprint/fpi-poll.c +++ b/libfprint/fpi-poll.c @@ -250,11 +250,18 @@ static int get_next_timeout_expiry(struct timeval *out, *out_timeout = next_timeout; if (timercmp(&tv, &next_timeout->expiry, >=)) { - fp_dbg("first timeout already expired"); + if (next_timeout->name) + fp_dbg("first timeout '%s' already expired", next_timeout->name); + else + fp_dbg("first timeout already expired"); timerclear(out); } else { timersub(&next_timeout->expiry, &tv, out); - fp_dbg("next timeout in %ld.%06lds", out->tv_sec, out->tv_usec); + if (next_timeout->name) + fp_dbg("next timeout '%s' in %ld.%06lds", next_timeout->name, + out->tv_sec, out->tv_usec); + else + fp_dbg("next timeout in %ld.%06lds", out->tv_sec, out->tv_usec); } return 1;