Module Name: src Committed By: njoly Date: Thu Apr 16 15:17:17 UTC 2015
Modified Files: src/sys/arch/x86/x86: procfs_machdep.c Log Message: Always output 2 digits for the cpu frequency decimal part. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/x86/procfs_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/procfs_machdep.c diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.6 src/sys/arch/x86/x86/procfs_machdep.c:1.7 --- src/sys/arch/x86/x86/procfs_machdep.c:1.6 Sat Apr 5 18:43:09 2014 +++ src/sys/arch/x86/x86/procfs_machdep.c Thu Apr 16 15:17:17 2015 @@ -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_in 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");