From 4ad77004d94bd09226184659b88b421b780499c7 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 5 Aug 2024 18:37:29 +0000 Subject: [PATCH] Fix reporting if critical battery state. ok jca@, mlarkin@ --- sys/dev/acpi/acpibat.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c index 75b6a1e44e8..7dc53ea6b1a 100644 --- a/sys/dev/acpi/acpibat.c +++ b/sys/dev/acpi/acpibat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibat.c,v 1.71 2024/06/24 15:56:07 mglocker Exp $ */ +/* $OpenBSD: acpibat.c,v 1.72 2024/08/05 18:37:29 kettenis Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -279,13 +279,11 @@ acpibat_refresh(void *arg) else if (sc->sc_bst.bst_state & BST_CHARGE) strlcpy(sc->sc_sens[4].desc, "battery charging", sizeof(sc->sc_sens[4].desc)); - else if (sc->sc_bst.bst_state & BST_CRITICAL) { - strlcpy(sc->sc_sens[4].desc, "battery critical", - sizeof(sc->sc_sens[4].desc)); - sc->sc_sens[4].status = SENSOR_S_CRIT; - } else + else strlcpy(sc->sc_sens[4].desc, "battery idle", sizeof(sc->sc_sens[4].desc)); + if (sc->sc_bst.bst_state & BST_CRITICAL) + sc->sc_sens[4].status = SENSOR_S_CRIT; sc->sc_sens[4].value = sc->sc_bst.bst_state; if (sc->sc_bst.bst_rate == BST_UNKNOWN) { -- 2.20.1