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:
parent
921d279e15
commit
e10d08df7e
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue