mirror of https://github.com/xzeldon/htop.git
Update delay accounting to use NAN on error
This commit is contained in:
parent
3c65d78d77
commit
321960bd96
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue