1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 08:43:40 -07:00

Fix 'load-average' on MS-Windows

* src/w32.c (getloadavg): Always return at least one element
of the array.
This commit is contained in:
Eli Zaretskii 2019-05-07 17:48:32 +03:00
parent 921d279e15
commit e10d08df7e

View file

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