In particular, libacpi.c: In function ‘procfs_get_battery_info’: libacpi.c:582:9: warning: variable ‘buflen’ set but not used [-Wunused-but-set-variable] int buflen; ^ --- wmacpi/libacpi.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/wmacpi/libacpi.c b/wmacpi/libacpi.c index fb77015..14d98d4 100644 --- a/wmacpi/libacpi.c +++ b/wmacpi/libacpi.c @@ -649,6 +649,10 @@ static int procfs_get_battery_info(global_t *globals, int batt_no) /* grab the file contents */ memset(buf, 0, sizeof(buf)); buflen = fread(buf, sizeof(buf), 1, file); + if (buflen != sizeof(buf) && ferror(file)) { + pfatal("Could not read file\n"); + return 1; + } fclose(file); /* check to see if there were any errors reported in the file */ -- 2.1.0 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.