char buf[16];
int fd;
int ret;
+ int retries = 0;
+retry:
fd = open(path, O_RDONLY);
if (fd < 0) {
printf("%s: Failed to open file %s: %m\n", __func__, path);
out_close:
close(fd);
+ if (*temp == 85) {
+ ret = -1;
+ if (retries < 3) {
+ retries++;
+ printf("Retrying 1wire read, try %d\n", retries);
+ goto retry;
+ }
+ }
+
return ret;
}