diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2018-08-14 01:11:46 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2018-08-14 01:11:46 +0200 |
commit | 375b723840ec5fadd8c40fdfd0982f1b3fa2cbbf (patch) | |
tree | 4fc4a06568c2fdf2fa6110418e86d18fead2e568 | |
parent | 281e1c98545887f19a4df1e50f9ef4bf2090fa40 (diff) | |
download | psutil-osx-temps-alternate.tar.gz |
avoid closing connectionosx-temps-alternate
-rw-r--r-- | psutil/arch/osx/smc.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/psutil/arch/osx/smc.c b/psutil/arch/osx/smc.c index 44e619b0..bda6210c 100644 --- a/psutil/arch/osx/smc.c +++ b/psutil/arch/osx/smc.c @@ -157,17 +157,13 @@ double SMCGetTemperature(io_connect_t conn, char *key) { result = SMCReadKey(conn, key, &val); if (result == kIOReturnSuccess) { - // read succeeded - check returned value if (val.dataSize > 0) { if (strcmp(val.dataType, DATATYPE_SP78) == 0) { - // convert sp78 value to temperature intValue = val.bytes[0] * 256 + (unsigned char)val.bytes[1]; - SMCClose(conn); return intValue / 256.0; } } } - // read failed return 0.0; } |