diff options
| author | njoly <njoly@NetBSD.org> | 2015-04-16 15:17:17 +0000 |
|---|---|---|
| committer | njoly <njoly@NetBSD.org> | 2015-04-16 15:17:17 +0000 |
| commit | 8cf2c40b9d9add0142e1585eb02ce2bebd7ffc77 (patch) | |
| tree | efee8631a380a84b4f386faf1c521ec211f8ccf5 | |
| parent | 2ed018bc7eb8c59df0225411d890a25774c1d233 (diff) | |
Always output 2 digits for the cpu frequency decimal part.
| -rw-r--r-- | sys/arch/x86/x86/procfs_machdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/x86/x86/procfs_machdep.c b/sys/arch/x86/x86/procfs_machdep.c index 2a9927adc76..58cf223547c 100644 --- a/sys/arch/x86/x86/procfs_machdep.c +++ b/sys/arch/x86/x86/procfs_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:43:09 christos Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.7 2015/04/16 15:17:17 njoly Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:43:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.7 2015/04/16 15:17:17 njoly Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -196,7 +196,7 @@ procfs_getonecpu(int xcpu, struct cpu_info *ci, char *bf, size_t *len) freq = (ci->ci_data.cpu_cc_freq + 4999) / 1000000; fraq = ((ci->ci_data.cpu_cc_freq + 4999) / 10000) % 100; - l = snprintf(p, left, "cpu MHz\t\t: %" PRIu64 ".%" PRIu64 "\n", + l = snprintf(p, left, "cpu MHz\t\t: %" PRIu64 ".%02" PRIu64 "\n", freq, fraq); } else l = snprintf(p, left, "cpu MHz\t\t: unknown\n"); |
