+ DBG("failed to fork(%s)",
+ strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
+ return -EIO;
+}
+
+static void no_wait_signal_handler()
+{
+ pid_t child_pid = 0;
+ int state = 0;
+
+ child_pid = waitpid(-1, &state, WNOHANG);
+
+ DBG("child_id(%d) state(%d)", child_pid, WEXITSTATUS(state));
+}
+
+int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
+{
+ pid_t pid = 0;
+ int rv = 0;
+ errno = 0;
+ register unsigned int index = 0;
+
+ 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);
+ act.sa_flags = 0;
+
+ state = sigaction(SIGCHLD, &act, 0);
+ if (state != 0) {
+ DBG("sigaction() : %d", state);
+ return -1;
+ }
+
+ while (args[index] != NULL) {
+ DBG("%s", args[index]);
+ index++;
+ }
+
+ if (!(pid = fork())) {
+ DBG("pid(%d), ppid (%d)", getpid(), getppid());
+ DBG("Inside child, exec (%s) command", file_path);
+
+ errno = 0;
+ if (execvp(file_path, args) == -1) {
+ ERR("Fail to execute command (%s)",
+ strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
+ return -1;
+ }
+ } else if (pid > 0) {
+ ERR("Successfully launched child process");
+ return rv;
+ }
+
+ DBG("failed to fork(%s)",
+ strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));