diff options
Diffstat (limited to 'src/w32.c')
-rw-r--r-- | src/w32.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c index 677c37fcb5d..833ff4c7e4a 100644 --- a/src/w32.c +++ b/src/w32.c @@ -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; } |