From c58dfd821ae2bb5aba5524116a096971d032a5dd Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 21 Jun 2007 10:39:39 +0200 Subject: [PATCH] load plugin: Fix the Linux code that reads `/proc/loadavg'. --- src/load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/load.c b/src/load.c index 5e1d9d30..22872f04 100644 --- a/src/load.c +++ b/src/load.c @@ -88,7 +88,7 @@ static int load_read (void) char errbuf[1024]; WARNING ("load: fopen: %s", sstrerror (errno, errbuf, sizeof (errbuf))); - return; + return (-1); } if (fgets (buffer, 16, loadavg) == NULL) @@ -97,7 +97,7 @@ static int load_read (void) WARNING ("load: fgets: %s", sstrerror (errno, errbuf, sizeof (errbuf))); fclose (loadavg); - return; + return (-1); } if (fclose (loadavg)) @@ -110,7 +110,7 @@ static int load_read (void) numfields = strsplit (buffer, fields, 8); if (numfields < 3) - return; + return (-1); snum = atof (fields[0]); mnum = atof (fields[1]); -- 2.30.2