From: robert Date: Wed, 12 Jan 2022 13:09:29 +0000 (+0000) Subject: set cpuspeed to 0 if hw.cpuspeed cannot be retrieved X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=73cd97e4d80d996f02f07f45c9dd3967a46ec287;p=openbsd set cpuspeed to 0 if hw.cpuspeed cannot be retrieved ok kettenis@ --- 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) {