diff --git a/src/battery.c b/src/battery.c
index 9b060dd9286cc692f03cd8205121868fe0f786ae..c501a301d143a48920f32a55317701b0d769a381 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);
if (status == 0)
return (0);
- ERROR ("battery plugin: Add available input methods failed.");
+ ERROR ("battery plugin: All available input methods failed.");
return (-1);
} /* }}} int battery_read */
#endif /* KERNEL_LINUX */