diff options
Diffstat (limited to 'AudioManagerDaemon/src/CAmWatchdog.cpp')
-rwxr-xr-x | AudioManagerDaemon/src/CAmWatchdog.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/AudioManagerDaemon/src/CAmWatchdog.cpp b/AudioManagerDaemon/src/CAmWatchdog.cpp index 830517d..4ac890f 100755 --- a/AudioManagerDaemon/src/CAmWatchdog.cpp +++ b/AudioManagerDaemon/src/CAmWatchdog.cpp @@ -56,11 +56,12 @@ CAmWatchdog::CAmWatchdog(CAmSocketHandler* CAmSocketHandler) : if (watchdogTimeout > 0) { timespec timeout; - logInfo("CAmWatchdog::CAmWatchdog setting watchdog timeout to ", watchdogTimeout, " museconds"); - //calulate the half cycle as the right interval to trigger the watchdog. - timeout.tv_sec = watchdogTimeout / 2000000; - timeout.tv_nsec = (watchdogTimeout % 1000000) * 500; + //calculate the half cycle as the right interval to trigger the watchdog. + timeout.tv_sec = (watchdogTimeout / 2) / 1000000; + timeout.tv_nsec = ((watchdogTimeout / 2) % 1000000) * 1000; + logInfo("CAmWatchdog::CAmWatchdog setting watchdog timeout:", watchdogTimeout, "us. Notification set to:", + timeout.tv_sec, "sec and", timeout.tv_nsec, "ns"); //add the timer here if (mpCAmSocketHandler->addTimer(timeout, &TimerCallback, mHandle, NULL)) |