sysctl(8): acpi temperature support for hw.acpi.thermal
authorConstantine A. Murenin <cnst+dfly@bugmail.mojo.ru>
Wed, 10 Feb 2010 22:45:41 +0000 (17:45 -0500)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 10 Feb 2010 22:51:59 +0000 (14:51 -0800)
sbin/sysctl/sysctl.c

index 750f96e..3e1fdbb 100644 (file)
@@ -695,6 +695,8 @@ show_var(int *oid, size_t nlen)
                while (len >= sizeof(int)) {
                        if(*fmt == 'U')
                                printf("%s%u", spacer, *(unsigned int *)p);
+                       else if (*fmt == 'K' && *(int *)p >= 0)
+                               printf("%s%.1fC", spacer, (*(int *)p - 2732) / 10.0);
                        else
                                printf("%s%d", spacer, *(int *)p);
                        spacer = " ";