summaryrefslogtreecommitdiff
path: root/usr.sbin/apm
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2022-01-12 13:09:30 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2022-01-12 13:09:30 +0000
commitdeb0bad5c3165c91f795511faa09fad437c51382 (patch)
treea397d324f1474f1b7b1318a13a1986735298dbdb /usr.sbin/apm
parentce87107aedc7a6c23b19b604b61054ed5657327d (diff)
set cpuspeed to 0 if hw.cpuspeed cannot be retrieved
ok kettenis@
Diffstat (limited to 'usr.sbin/apm')
-rw-r--r--usr.sbin/apm/apm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/apm/apm.c b/usr.sbin/apm/apm.c
index f8962969795..918a164944e 100644
--- a/usr.sbin/apm/apm.c
+++ b/usr.sbin/apm/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.38 2021/04/06 20:30:32 kn Exp $ */
+/* $OpenBSD: apm.c,v 1.39 2022/01/12 13:09:29 robert Exp $ */
/*
* Copyright (c) 1996 John T. Kohl
@@ -163,7 +163,7 @@ main(int argc, char *argv[])
size_t cpuspeed_sz = sizeof(cpuspeed);
if (sysctl(cpuspeed_mib, 2, &cpuspeed, &cpuspeed_sz, NULL, 0) == -1)
- err(1, "sysctl hw.cpuspeed");
+ cpuspeed = 0;
while ((ch = getopt(argc, argv, "ACHLlmbvaPSzZf:")) != -1) {
switch (ch) {