mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
Battery (Haiku): handle empty slots
Some checks failed
CI / spellcheck (push) Has been cancelled
CI / No-features-test (push) Has been cancelled
CI / Linux-amd64 (push) Has been cancelled
CI / Linux-aarch64 (push) Has been cancelled
CI / Linux-armv7l (push) Has been cancelled
CI / Linux-armv6l (push) Has been cancelled
CI / Linux-riscv64 (push) Has been cancelled
CI / Linux-ppc64le (push) Has been cancelled
CI / Linux-s390x (push) Has been cancelled
CI / Musl-amd64 (push) Has been cancelled
CI / macOS-universal (push) Has been cancelled
CI / SunOS-amd64 (push) Has been cancelled
CI / FreeBSD-amd64 (push) Has been cancelled
CI / DragonFly-amd64 (push) Has been cancelled
CI / OpenBSD-amd64 (push) Has been cancelled
CI / NetBSD-amd64 (push) Has been cancelled
CI / Windows-amd64 (push) Has been cancelled
CI / Release (push) Has been cancelled
Some checks failed
CI / spellcheck (push) Has been cancelled
CI / No-features-test (push) Has been cancelled
CI / Linux-amd64 (push) Has been cancelled
CI / Linux-aarch64 (push) Has been cancelled
CI / Linux-armv7l (push) Has been cancelled
CI / Linux-armv6l (push) Has been cancelled
CI / Linux-riscv64 (push) Has been cancelled
CI / Linux-ppc64le (push) Has been cancelled
CI / Linux-s390x (push) Has been cancelled
CI / Musl-amd64 (push) Has been cancelled
CI / macOS-universal (push) Has been cancelled
CI / SunOS-amd64 (push) Has been cancelled
CI / FreeBSD-amd64 (push) Has been cancelled
CI / DragonFly-amd64 (push) Has been cancelled
CI / OpenBSD-amd64 (push) Has been cancelled
CI / NetBSD-amd64 (push) Has been cancelled
CI / Windows-amd64 (push) Has been cancelled
CI / Release (push) Has been cancelled
My ThinkPad has a second slot for external batteries.
This commit is contained in:
parent
6e98db3bf3
commit
3e5d129248
@ -18,6 +18,9 @@ const char* parseBattery(int dfd, const char* battId, FFlist* results)
|
|||||||
if (ioctl(fd, GET_EXTENDED_BATTERY_INFO, &extended, sizeof(extended)) != 0)
|
if (ioctl(fd, GET_EXTENDED_BATTERY_INFO, &extended, sizeof(extended)) != 0)
|
||||||
return "ioctl(GET_EXTENDED_BATTERY_INFO) failed";
|
return "ioctl(GET_EXTENDED_BATTERY_INFO) failed";
|
||||||
|
|
||||||
|
if (extended.last_full_charge == (uint32)-1)
|
||||||
|
return "Skipped";
|
||||||
|
|
||||||
FFBatteryResult* battery = (FFBatteryResult*)ffListAdd(results);
|
FFBatteryResult* battery = (FFBatteryResult*)ffListAdd(results);
|
||||||
ffStrbufInitS(&battery->modelName, extended.model_number);
|
ffStrbufInitS(&battery->modelName, extended.model_number);
|
||||||
ffStrbufInitS(&battery->manufacturer, extended.oem_info);
|
ffStrbufInitS(&battery->manufacturer, extended.oem_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user