summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid J. MacKenzie <djm@gnu.org>1993-07-12 22:13:12 +0000
committerDavid J. MacKenzie <djm@gnu.org>1993-07-12 22:13:12 +0000
commitc2cc8e33fb57d5d1fc2675a69288d72ea906aee7 (patch)
tree650b4ff14ef30dc196dcbe2dd6722ab2d7ca0b95
parentaf7ef68647718c67838e08f7d3c1b94e1f6df82b (diff)
downloadgunmake-c2cc8e33fb57d5d1fc2675a69288d72ea906aee7.tar.gz
*** empty log message ***
-rw-r--r--getloadavg.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/getloadavg.c b/getloadavg.c
index 49612bf..8dba8a1 100644
--- a/getloadavg.c
+++ b/getloadavg.c
@@ -436,7 +436,7 @@ static kvm_t *kd;
/* Put the 1 minute, 5 minute and 15 minute load averages
into the first NELEM elements of LOADAVG.
- Return the number written (never more than 3),
+ Return the number written (never more than 3, but may be less than NELEM),
or -1 if an error occurred. */
int
@@ -494,12 +494,8 @@ getloadavg (loadavg, nelem)
struct processor_set_basic_info info;
unsigned info_count;
- if (nelem > 1)
- {
- /* We only know how to get the 1-minute average for this system. */
- errno = EINVAL;
- return -1;
- }
+ /* We only know how to get the 1-minute average for this system,
+ so even if the caller asks for more than 1, we only return 1. */
if (!getloadavg_initialized)
{