From 43d7f0ed4a578c2a4abb0a0e967311390675b53a Mon Sep 17 00:00:00 2001 From: Drath Date: Wed, 24 Jun 2026 21:07:30 +0200 Subject: [PATCH] thinkinh --- src/utils.c | 1 + 1 file changed, 1 insertion(+) 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