From 49076ec69dd7efc3385e12f85bf9ef9f61ea9b78 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 12 Oct 2024 10:41:25 +0800 Subject: [PATCH] Battery (Linux): simplify --- src/detection/battery/battery_linux.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/detection/battery/battery_linux.c b/src/detection/battery/battery_linux.c index 025aee692..71ea2480a 100644 --- a/src/detection/battery/battery_linux.c +++ b/src/detection/battery/battery_linux.c @@ -160,10 +160,7 @@ static void parseBattery(int dfd, const char* id, FFBatteryOptions* options, FFl const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results) { - FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateA(64); - ffStrbufAppendS(&baseDir, "/sys/class/power_supply/"); - - FF_AUTO_CLOSE_DIR DIR* dirp = opendir(baseDir.chars); + FF_AUTO_CLOSE_DIR DIR* dirp = opendir("/sys/class/power_supply/"); if(dirp == NULL) return "opendir(\"/sys/class/power_supply/\") == NULL";