diff --git a/userspace/falco/stats_writer.cpp b/userspace/falco/stats_writer.cpp index 4fa4d8a6..68ec83a1 100644 --- a/userspace/falco/stats_writer.cpp +++ b/userspace/falco/stats_writer.cpp @@ -62,7 +62,11 @@ bool stats_writer::init_ticker(uint32_t interval_msec, std::string &err) // delete any previously set timer if (s_timerid) { - timer_delete(s_timerid); + if (timer_delete(s_timerid) == -1) + { + err = std::string("Failed to delete existing timer: ") + strerror(errno); + return false; + } } if (timer_create(CLOCK_MONOTONIC, &sev, &s_timerid) == -1) { err = std::string("Could not create periodic timer: ") + strerror(errno);