projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3339 from jkohen/patch-1
[collectd.git]
/
src
/
battery.c
diff --git
a/src/battery.c
b/src/battery.c
index
8e6c4b2
..
9b5b82d
100644
(file)
--- a/
src/battery.c
+++ b/
src/battery.c
@@
-336,7
+336,7
@@
static int battery_read(void) /* {{{ */
return 0;
} /* }}} int battery_read */
return 0;
} /* }}} int battery_read */
-/* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */
+
/* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */
#elif KERNEL_LINUX
/* Reads a file which contains only a number (and optionally a trailing
#elif KERNEL_LINUX
/* Reads a file which contains only a number (and optionally a trailing
@@
-349,12
+349,10
@@
static int sysfs_file_to_buffer(char const *dir, /* {{{ */
snprintf(filename, sizeof(filename), "%s/%s/%s", dir, power_supply, basename);
snprintf(filename, sizeof(filename), "%s/%s/%s", dir, power_supply, basename);
- status = (int)read_
file_contents(filename, buffer, buffer_size - 1
);
+ status = (int)read_
text_file_contents(filename, buffer, buffer_size
);
if (status < 0)
return status;
if (status < 0)
return status;
- buffer[status] = '\0';
-
strstripnewline(buffer);
return 0;
} /* }}} int sysfs_file_to_buffer */
strstripnewline(buffer);
return 0;
} /* }}} int sysfs_file_to_buffer */