X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fbattery.c;h=b87739ac7d03affe2f20047d161f77b2b2d85001;hb=c13a935c8bdb40daf1f7078fc81bf05b90c7cd90;hp=9b060dd9286cc692f03cd8205121868fe0f786ae;hpb=eea01a8f212634414a21462ba79dc058dc5fb304;p=collectd.git diff --git a/src/battery.c b/src/battery.c index 9b060dd9..b87739ac 100644 --- a/src/battery.c +++ b/src/battery.c @@ -143,7 +143,7 @@ static void submit_capacity (char const *plugin_instance, /* {{{ */ } /* }}} void submit_capacity */ #if HAVE_IOKIT_PS_IOPOWERSOURCES_H || HAVE_IOKIT_IOKITLIB_H -static double dict_get_double (CFDictionaryRef dict, char *key_string) /* {{{ */ +static double dict_get_double (CFDictionaryRef dict, const char *key_string) /* {{{ */ { double val_double; long long val_int; @@ -556,7 +556,7 @@ static int read_acpi_full_capacity (char const *dir, /* {{{ */ 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 */ @@ -615,7 +615,7 @@ static int read_acpi_callback (char const *dir, /* {{{ */ 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);