summaryrefslogtreecommitdiffstats
path: root/src/hardware/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardware/utils.c')
-rw-r--r--src/hardware/utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hardware/utils.c b/src/hardware/utils.c
index 305cc1e..fdce75d 100644
--- a/src/hardware/utils.c
+++ b/src/hardware/utils.c
@@ -132,6 +132,7 @@ short run_command(const char *command, char ***buffer, unsigned *buffer_size)
{
FILE *fp = NULL;
short ret = -1;
+ char errbuf[STRERROR_BUF_LEN];
/* if command is empty */
if (!command || strlen(command) < 1) {
@@ -144,7 +145,7 @@ short run_command(const char *command, char ***buffer, unsigned *buffer_size)
fp = popen(command, "r");
if (!fp) {
warn("Failed to run command: \"%s\"; Error: %s",
- command, strerror(errno));
+ command, strerror_r(errno, errbuf, sizeof(errbuf)));
goto done;
}
@@ -159,7 +160,7 @@ done:
int ret_code = pclose(fp);
if (ret_code == -1) {
warn("Failed to run command: \"%s\"; Error: %s",
- command, strerror(errno));
+ command, strerror_r(errno, errbuf, sizeof(errbuf)));
if (ret == 0) {
ret = -1;
}