1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 14:09:13 +00:00

Fix hddtemp with disabled drives.

Some drives are unable to return their temperature when in standby mode.
If there is more than one drive installed then other drives may not be
able to get parsed. This patch will skip over the unparsable output for
the current drive and let others get parsed.

Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
This commit is contained in:
Ben Kibbey 2010-01-01 14:49:35 -08:00 committed by Brenden Matthews
parent c7bf4092a4
commit 6e6a1f59e8

View File

@ -173,6 +173,7 @@ static int read_hdd_val(const char *line, char **dev, short *val, char *unit,
}
line_s = *saveptr;
again:
/* read the device */
*dev = ++p;
if (!(p = strchr(p, line_s[0])))
@ -188,9 +189,14 @@ static int read_hdd_val(const char *line, char **dev, short *val, char *unit,
*(p++) = '\0';
*unit = *(p++);
*val = strtol(cval, &endptr, 10);
if (*endptr)
if (*endptr) {
if (!(p = strchr(p, line_s[0])))
goto out_fail;
p++;
goto again;
}
/* preset p for next call */
p++;