pe_data.stdout = fds[1];
pid = run_helper(change_pre_exec, &pe_data, argv, NULL);
- os_close_file(fds[1]);
read_output(fds[0], output, output_len);
+ os_close_file(fds[0]);
+ os_close_file(fds[1]);
- CATCH_EINTR(err = waitpid(pid, NULL, 0));
+ if (pid > 0)
+ CATCH_EINTR(err = waitpid(pid, NULL, 0));
return(pid);
}