chore(userspace/falco): fail if timer_delete fails too.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro
2023-10-04 13:23:01 +02:00
parent f2a0774609
commit 432545fbb8

View File

@@ -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);