diff options
Diffstat (limited to 'src/hardware/lsblk.c')
-rw-r--r-- | src/hardware/lsblk.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/hardware/lsblk.c b/src/hardware/lsblk.c index 512ccad..a6d2980 100644 --- a/src/hardware/lsblk.c +++ b/src/hardware/lsblk.c @@ -85,7 +85,7 @@ short check_lsblkhdd_attributes(LsblkHdd *hdd) done: if (ret != 0) { - warn("Failed to allocate memory."); + lmi_warn("Failed to allocate memory."); } return ret; @@ -95,7 +95,7 @@ short lsblk_get_hdds(LsblkHdd **hdds, unsigned *hdds_nb) { short ret = -1; unsigned i, curr_hdd = 0, buffer_size = 0; - char **buffer = NULL, *path, *type, *buf, errbuf[STRERROR_BUF_LEN]; + char **buffer = NULL, *path, *type, *buf, errbuf[BUFLEN]; struct stat sb; unsigned long capacity = 0; @@ -112,14 +112,14 @@ short lsblk_get_hdds(LsblkHdd **hdds, unsigned *hdds_nb) /* if no hard drive was found */ if (*hdds_nb < 1) { - warn("Lsblk didn't recognize any hard drive."); + lmi_warn("Lsblk didn't recognize any hard drive."); goto done; } /* allocate memory for hard drives */ *hdds = (LsblkHdd *)calloc(*hdds_nb, sizeof(LsblkHdd)); if (!(*hdds)) { - warn("Failed to allocate memory."); + lmi_warn("Failed to allocate memory."); *hdds_nb = 0; goto done; } @@ -131,13 +131,13 @@ short lsblk_get_hdds(LsblkHdd **hdds, unsigned *hdds_nb) continue; } if (stat(path, &sb) != 0) { - warn("Stat() call on file \"%s\" failed: %s", + lmi_warn("Stat() call on file \"%s\" failed: %s", path, strerror_r(errno, errbuf, sizeof(errbuf))); free(path); continue; } if ((sb.st_mode & S_IFMT) != S_IFBLK) { - warn("File \"%s\" is not a block device.", path); + lmi_warn("File \"%s\" is not a block device.", path); free(path); continue; } @@ -181,7 +181,7 @@ short lsblk_get_hdds(LsblkHdd **hdds, unsigned *hdds_nb) (*hdds)[curr_hdd].basename = strdup(basename(path)); if (!(*hdds)[curr_hdd].basename) { - warn("Failed to allocate memory."); + lmi_warn("Failed to allocate memory."); goto done; } @@ -189,11 +189,11 @@ short lsblk_get_hdds(LsblkHdd **hdds, unsigned *hdds_nb) } if (curr_hdd != *hdds_nb) { - warn("Not all reported drives by lsblk were processed."); + lmi_warn("Not all reported drives by lsblk were processed."); LsblkHdd *tmp_hdd = (LsblkHdd *)realloc(*hdds, curr_hdd * sizeof(LsblkHdd)); if (!tmp_hdd) { - warn("Failed to allocate memory."); + lmi_warn("Failed to allocate memory."); goto done; } *hdds = tmp_hdd; |