Update delay accounting to use NAN on error

This commit is contained in:
Benny Baumann 2020-09-18 17:04:01 +02:00 committed by cgzones
parent 3c65d78d77
commit 321960bd96
2 changed files with 4 additions and 4 deletions

View File

@ -182,7 +182,7 @@ bool LinuxProcess_setIOPriority(LinuxProcess* this, Arg ioprio) {
#ifdef HAVE_DELAYACCT #ifdef HAVE_DELAYACCT
void LinuxProcess_printDelay(float delay_percent, char* buffer, int n) { void LinuxProcess_printDelay(float delay_percent, char* buffer, int n) {
if (delay_percent == -1LL) { if (isnan(delay_percent)) {
xSnprintf(buffer, n, " N/A "); xSnprintf(buffer, n, " N/A ");
} else { } else {
xSnprintf(buffer, n, "%4.1f ", delay_percent); xSnprintf(buffer, n, "%4.1f ", delay_percent);

View File

@ -681,9 +681,9 @@ static void LinuxProcessList_readDelayAcctData(LinuxProcessList* this, LinuxProc
} }
if (nl_send_sync(this->netlink_socket, msg) < 0) { if (nl_send_sync(this->netlink_socket, msg) < 0) {
process->swapin_delay_percent = -1LL; process->swapin_delay_percent = NAN;
process->blkio_delay_percent = -1LL; process->blkio_delay_percent = NAN;
process->cpu_delay_percent = -1LL; process->cpu_delay_percent = NAN;
return; return;
} }