diff --git a/src/utils.c b/src/utils.c index d670043..5294ce3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -84,6 +84,7 @@ int get_hwmon_dir(char *path, const size_t bufsz) { * actual slowdown is in the syscalls anyway, open(), read(), close () */ /* read n bytes from path into buffer */ +// file descriptors shouldnt change once opened, so we could open once, cache them, just call read() in the loop, then close all of them on program exit? inline size_t read_file(const char *dir, const char *file, char *buffer, const size_t n) { char path[160]; // bug alert char *nt = stpcpy(path, dir); // nt is a pointer to the null terminator of the copied string