mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-22 13:34:19 +02:00
Set default capacity to -1
Signed-off-by: AnErrupTion <anerruption+codeberg@disroot.org>
This commit is contained in:
parent
9a70efafd8
commit
7346b4343d
1 changed files with 1 additions and 1 deletions
|
|
@ -2320,7 +2320,7 @@ fn getBatteryPercentage(io: std.Io, battery_id: []const u8) !u8 {
|
|||
// battery_id is unused on FreeBSD; sysctl exposes a single aggregate value.
|
||||
// For multi-battery systems the MIB would be hw.acpi.battery.N.life,
|
||||
// but hw.acpi.battery.life is the standard single-battery interface.
|
||||
var capacity: c_int = undefined;
|
||||
var capacity: c_int = -1;
|
||||
var size: usize = @sizeOf(c_int);
|
||||
|
||||
const ret = sysctl.sysctlbyname("hw.acpi.battery.life", &capacity, &size, null, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue