X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/9750a3d731cd381e832bcacf1d03e48ddb46cc16..6464cea333144a5d0e3baa02c9c9ecad4b3c53bf:/components/temperature.c 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;