X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/9750a3d731cd381e832bcacf1d03e48ddb46cc16..16a97fbca129bca5656f76191c1b324b1649ec22:/components/temperature.c diff --git a/components/temperature.c b/components/temperature.c index 1353993..136e0d4 100644 --- a/components/temperature.c +++ b/components/temperature.c @@ -16,9 +16,9 @@ #include #include #include + #include #include #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;