summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d6491cf)
raw | patch | inline | side by side (parent: d6491cf)
author | Florian Forster <octo@collectd.org> | |
Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 18 Jun 2015 08:03:14 +0000 (10:03 +0200) |
src/battery.c | patch | blob | history |
diff --git a/src/battery.c b/src/battery.c
index 9b060dd9286cc692f03cd8205121868fe0f786ae..c4c050d7ff1cd11cc70cd2d17323f90da747e542 100644 (file)
--- a/src/battery.c
+++ b/src/battery.c
ssnprintf (filename, sizeof (filename), "%s/%s/info", dir, power_supply);
fh = fopen (filename, "r");
- if ((fh = fopen (filename, "r")) == NULL)
+ if (fh == NULL)
return (errno);
/* last full capacity: 40090 mWh */
ssnprintf (filename, sizeof (filename), "%s/%s/state", dir, power_supply);
fh = fopen (filename, "r");
- if ((fh = fopen (filename, "r")) == NULL)
+ if (fh == NULL)
{
if ((errno == EAGAIN) || (errno == EINTR) || (errno == ENOENT))
return (0);