summaryrefslogtreecommitdiffstats
path: root/src/hardware/smartctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardware/smartctl.c')
-rw-r--r--src/hardware/smartctl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/hardware/smartctl.c b/src/hardware/smartctl.c
index d637acc..452700d 100644
--- a/src/hardware/smartctl.c
+++ b/src/hardware/smartctl.c
@@ -102,7 +102,7 @@ short check_smctlhdd_attributes(SmartctlHdd *hdd)
done:
if (ret != 0) {
- warn("Failed to allocate memory.");
+ lmi_warn("Failed to allocate memory.");
}
return ret;
@@ -121,7 +121,7 @@ short scan_smctlhdd_devices(SmartctlHdd **hdds, unsigned *hdds_nb)
unsigned i, curr_hdd = 0, buffer_size = 0, sec_buffer_size = 0;
char **buffer = NULL, **sec_buffer = NULL;
struct stat sb;
- char errbuf[STRERROR_BUF_LEN];
+ char errbuf[BUFLEN];
smartctl_free_hdds(hdds, hdds_nb);
@@ -135,14 +135,14 @@ short scan_smctlhdd_devices(SmartctlHdd **hdds, unsigned *hdds_nb)
/* if no hard drive was found */
if (*hdds_nb < 1) {
- warn("Smartctl didn't recognize any hard drive.");
+ lmi_warn("Smartctl didn't recognize any hard drive.");
goto done;
}
/* allocate memory for hard drives */
*hdds = (SmartctlHdd *)calloc(*hdds_nb, sizeof(SmartctlHdd));
if (!(*hdds)) {
- warn("Failed to allocate memory.");
+ lmi_warn("Failed to allocate memory.");
*hdds_nb = 0;
goto done;
}
@@ -156,14 +156,14 @@ short scan_smctlhdd_devices(SmartctlHdd **hdds, unsigned *hdds_nb)
}
if (stat(sec_buffer[0], &sb) != 0) {
- warn("Stat() call on file \"%s\" failed: %s",
+ lmi_warn("Stat() call on file \"%s\" failed: %s",
sec_buffer[0], strerror_r(errno, errbuf, sizeof(errbuf)));
free_2d_buffer(&sec_buffer, &sec_buffer_size);
continue;
}
if ((sb.st_mode & S_IFMT) != S_IFBLK) {
- warn("File \"%s\" is not a block device.", sec_buffer[0]);
+ lmi_warn("File \"%s\" is not a block device.", sec_buffer[0]);
free_2d_buffer(&sec_buffer, &sec_buffer_size);
continue;
}
@@ -173,7 +173,7 @@ short scan_smctlhdd_devices(SmartctlHdd **hdds, unsigned *hdds_nb)
(*hdds)[curr_hdd].dev_path = strdup(sec_buffer[0]);
(*hdds)[curr_hdd].dev_basename = strdup(basename(sec_buffer[0]));
if (!(*hdds)[curr_hdd].dev_path || !(*hdds)[curr_hdd].dev_basename) {
- warn("Failed to allocate memory.");
+ lmi_warn("Failed to allocate memory.");
free_2d_buffer(&sec_buffer, &sec_buffer_size);
continue;
}
@@ -183,12 +183,12 @@ short scan_smctlhdd_devices(SmartctlHdd **hdds, unsigned *hdds_nb)
}
if (curr_hdd != *hdds_nb) {
- warn("There's some \"smartctl --scan\" output mismatch, "
+ lmi_warn("There's some \"smartctl --scan\" output mismatch, "
"not all reported drives were processed.");
SmartctlHdd *tmp_hdd = (SmartctlHdd *)realloc(*hdds,
curr_hdd * sizeof(SmartctlHdd));
if (!tmp_hdd) {
- warn("Failed to allocate memory.");
+ lmi_warn("Failed to allocate memory.");
goto done;
}
*hdds = tmp_hdd;
@@ -355,7 +355,7 @@ short smartctl_get_hdds(SmartctlHdd **hdds, unsigned *hdds_nb)
sscanf(buf2, "%lu", &(*hdds)[curr_hdd].capacity);
free(buf2);
} else {
- warn("Failed to allocate memory.");
+ lmi_warn("Failed to allocate memory.");
}
free(buf);
buf = NULL;