commit 311f1ed9305fbaadc78ecd85c50e3b2df87e5567
parent 5334192a401aaa7ff17d0f12f46d02764ac4d11c
Author: sin <sin@2f30.org>
Date: Wed, 2 Nov 2016 14:15:40 +0000
Add comment for magic number in conversion
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/temp.c b/temp.c
@@ -21,6 +21,7 @@ tempread(void *arg, char *buf, size_t len)
sz = sizeof(temp);
if (sysctl(mib, 5, &temp, &sz, NULL, 0) == -1)
return -1;
+ /* temp.value is in kelvin so convert to celsius for display */
snprintf(buf, len, "%ddegC", (temp.value - 273150000) / 1000000);
return 0;
}