X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/9750a3d731cd381e832bcacf1d03e48ddb46cc16..ea2e2bd00403e02bee6298cfbb78eaa45869c851:/components/temperature.c?ds=sidebyside diff --git a/components/temperature.c b/components/temperature.c index 1353993..35bdb01 100644 --- a/components/temperature.c +++ b/components/temperature.c @@ -16,9 +16,9 @@ #include #include #include - #include - #include + #include /* before for struct timeval */ #include + #include const char * temp(const char *null) @@ -35,7 +35,7 @@ size = sizeof(temp); - if (sysctl(mib, 5, &temp, &size, NULL, 0) == -1) { + if (sysctl(mib, 5, &temp, &size, NULL, 0) < 0) { fprintf(stderr, "sysctl 'SENSOR_TEMP': %s\n", strerror(errno)); return NULL;