mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-15 09:47:20 +00: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:
parent
921d279e15
commit
e10d08df7e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user