Commit e10d08df authored by Eli Zaretskii's avatar Eli Zaretskii

Fix 'load-average' on MS-Windows

* src/w32.c (getloadavg): Always return at least one element
of the array.
parent 921d279e
Pipeline #1597 failed with stage
in 51 minutes and 9 seconds
......@@ -2003,6 +2003,13 @@ getloadavg (double loadavg[], int nelem)
loadavg[elem] = avg;
}
/* Always return at least one element, otherwise load-average
returns nil, and Lisp programs might decide we cannot measure
system load. For example, jit-lock-stealth-load's defcustom
might decide that feature is "unsupported". */
if (elem == 0)
loadavg[elem++] = 0.09; /* < display-time-load-average-threshold */
return elem;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment