if (rc < 0) {
if (errno == EINTR)
return 1;
- pb_log("%s: read failed: %s\n", __func__, strerror(errno));
+ pb_log_fn("read failed: %s\n", strerror(errno));
return rc;
}
{
int rc;
- if (!procinfo->process.keep_stdout)
+ if (!procinfo->process.keep_stdout || procinfo->process.raw_stdout)
return 0;
procinfo->stdout_buf_len = 4096;
static void process_setup_stdout_parent(struct process_info *procinfo)
{
- if (!procinfo->process.keep_stdout)
+ if (!procinfo->process.keep_stdout || procinfo->process.raw_stdout)
return;
close(procinfo->stdout_pipe[1]);
{
int log = fileno(pb_log_get_stream());
+ if (procinfo->process.raw_stdout)
+ return;
+
if (procinfo->process.keep_stdout)
dup2(procinfo->stdout_pipe[1], STDOUT_FILENO);
else
rc = write(procset->sigchld_pipe[1], &pid, sizeof(pid));
if (rc != sizeof(pid))
- pb_log("%s: write failed: %s\n", __func__, strerror(errno));
+ pb_log_fn("write failed: %s\n", strerror(errno));
}
static int sigchld_pipe_event(void *arg)
rc = pipe(procset->sigchld_pipe);
if (rc) {
- pb_log("%s: pipe() failed: %s\n", __func__, strerror(errno));
+ pb_log_fn("pipe() failed: %s\n", strerror(errno));
goto err_free;
}
rc = sigaction(SIGCHLD, &sa, NULL);
if (rc) {
- pb_log("%s: sigaction() failed: %s\n", __func__,
+ pb_log_fn("sigaction() failed: %s\n",
strerror(errno));
goto err_remove;
}
pid = fork();
if (pid < 0) {
- pb_log("%s: fork failed: %s\n", __func__, strerror(errno));
+ pb_log_fn("fork failed: %s\n", strerror(errno));
return pid;
}
if (errno == EINTR)
continue;
- pb_log("%s: waitpid failed: %s\n", __func__, strerror(errno));
+ pb_log_fn("waitpid failed: %s\n", strerror(errno));
return rc;
}