From c93ae21114e56f97641c58141b28df05e74b5494 Mon Sep 17 00:00:00 2001 From: drath Date: Mon, 11 May 2026 10:51:48 +0200 Subject: [PATCH] cleanup --- src/main.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main.c b/src/main.c index 9b773e4..3156bca 100644 --- a/src/main.c +++ b/src/main.c @@ -1,22 +1,23 @@ #include #include #include -#include "log.h" #include #include #include #include +#include + #include "lcd.h" +#include "log.h" #include "cpu.h" #include "gpu.h" #include "sys.h" #include "utils.h" -#include - -#pragma GCC diagnostic ignored "-Wunused-result" - static constexpr uint16_t refresh_interval_ms = 500; +static constexpr char netif[] = "enp7s0"; +static constexpr char cpu_pcidev[] = "0000:00:18.3"; +static constexpr char gpu_pcidev[] = "0000:0a:00.0"; struct control_t { pthread_mutex_t sensors_mtx; @@ -44,9 +45,9 @@ static void *sensors_thread(void *arg) { // set up paths for the sensors strcpy(sensors->home.mountpoint, "/home/drath"); - strcpy(sensors->net.device, "enp7s0"); - cpu_detect(&sensors->cpu, "0000:00:18.3"); - gpu_detect(&sensors->gpu, "0000:0a:00.0"); + strcpy(sensors->net.device, netif); + cpu_detect(&sensors->cpu, cpu_pcidev); + gpu_detect(&sensors->gpu, gpu_pcidev); sys_detect(&sensors->sys, "nct6775.656"); while (control.g_running) { // NOLINT @@ -186,7 +187,8 @@ int main(void) { pthread_create(&display_pthread, nullptr, display_thread, sensors); pthread_create(&sensors_pthread, nullptr, sensors_thread, sensors); - read(sfd, &info, sizeof(info)); // halts on this until SIGTERM + const ssize_t ret = read(sfd, &info, sizeof(info)); // halts on this until SIGTERM + (void)ret; /* cleanup on exit signal */ applog(LOG_WRN, "got stop signal, shutting down...");