From: Florian Forster Date: Thu, 21 Jun 2007 08:39:39 +0000 (+0200) Subject: load plugin: Fix the Linux code that reads `/proc/loadavg'. X-Git-Tag: collectd-4.0.4~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c58dfd821ae2bb5aba5524116a096971d032a5dd;p=collectd.git load plugin: Fix the Linux code that reads `/proc/loadavg'. --- 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]);