diff --git a/src/hddtemp.c b/src/hddtemp.c
index cbe6e80ab541f6f0b0a003f74d93d7bccfa8a90f..80b3419bee76d3e96efacb242bdba4f946efc5be 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
fd = -1;
continue;
}
fd = -1;
continue;
}
+
+ /* A socket could be opened and connecting succeeded. We're
+ * done. */
+ break;
}
freeaddrinfo (ai_list);
}
freeaddrinfo (ai_list);
syslog (LOG_ERR, "hddtemp: Error reading from socket: %s",
strerror (errno));
syslog (LOG_ERR, "hddtemp: Error reading from socket: %s",
strerror (errno));
+ close (fd);
return (-1);
}
buffer_fill += status;
return (-1);
}
buffer_fill += status;
first_hddname = entry;
}
}
first_hddname = entry;
}
}
+ fclose (fh);
}
else
DBG ("Could not open /proc/partitions: %s",
}
else
DBG ("Could not open /proc/partitions: %s",