diff options
author | Jim Rees <rees@cvs.openbsd.org> | 1997-12-03 00:19:33 +0000 |
---|---|---|
committer | Jim Rees <rees@cvs.openbsd.org> | 1997-12-03 00:19:33 +0000 |
commit | 24f0f18aee9671cef8f7ebda56303c67bb93ecd0 (patch) | |
tree | 97441b56cdf2a4f17726fb0d1b35a517769bb3fb /sys/arch | |
parent | 4b8c5a30a403ee0d95e641eb05cd9cd9b8fede65 (diff) |
fix printfs in apm_power_print
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/apm.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 59d948ac194..6ff432b594d 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.15 1997/11/30 18:59:19 rees Exp $ */ +/* $OpenBSD: apm.c,v 1.16 1997/12/03 00:19:32 rees Exp $ */ /*- * Copyright (c) 1995 John T. Kohl. All rights reserved. @@ -219,22 +219,22 @@ apm_power_print (sc, regs) if (apm_minver == 0) switch (BATT_STATE(regs)) { case APM_BATT_HIGH: - printf("high\n"); + printf("high"); break; case APM_BATT_LOW: - printf("low\n"); + printf("low"); break; case APM_BATT_CRITICAL: - printf("critical\n"); + printf("critical"); break; case APM_BATT_CHARGING: - printf("charging\n"); + printf("charging"); break; case APM_BATT_UNKNOWN: - printf("unknown\n"); + printf("unknown"); break; default: - printf("undecoded (%x)\n", BATT_STATE(regs)); + printf("undecoded (%x)", BATT_STATE(regs)); break; } else if (apm_minver >= 1) { @@ -243,16 +243,18 @@ apm_power_print (sc, regs) else { if (BATT_FLAGS(regs) & APM_BATT_FLAG_HIGH) printf("high"); - if (BATT_FLAGS(regs) & APM_BATT_FLAG_LOW) + else if (BATT_FLAGS(regs) & APM_BATT_FLAG_LOW) printf("low"); - if (BATT_FLAGS(regs) & APM_BATT_FLAG_CRITICAL) + else if (BATT_FLAGS(regs) & APM_BATT_FLAG_CRITICAL) printf("critical"); + else + printf("unknown"); if (BATT_FLAGS(regs) & APM_BATT_FLAG_CHARGING) - printf("charging"); + printf(", charging"); if (BATT_REM_VALID(regs)) - printf(", estimated %d:%02d minutes\n", + printf(", estimated %d:%02d minutes", BATT_REMAINING(regs) / 60, - BATT_REMAINING(regs)%60); + BATT_REMAINING(regs) % 60); } } @@ -512,7 +514,11 @@ apm_set_powstate(dev, state) return 0; } +#ifdef HANDBOOK +int apmidleon = 0; +#else int apmidleon = 1; +#endif void apm_cpu_busy() |