Fixed some svaces for strerror
[platform/core/connectivity/net-config.git] / src / utils / util.c
index 3c1c60a..b45cea2 100755 (executable)
@@ -582,6 +582,7 @@ int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
 
        struct sigaction act;
        int state = 0;
+       char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
 
        act.sa_handler = no_wait_signal_handler;
        sigemptyset(&act.sa_mask);
@@ -604,7 +605,8 @@ int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
 
                errno = 0;
                if (execvp(file_path, args) == -1) {
-                       ERR("Fail to execute command (%s)", strerror(errno));
+                       ERR("Fail to execute command (%s)",
+                               strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
                        return -1;
                }
        } else if (pid > 0) {
@@ -612,7 +614,8 @@ int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
                return rv;
        }
 
-       DBG("failed to fork(%s)", strerror(errno));
+       DBG("failed to fork(%s)",
+               strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
        return -EIO;
 }