63 int fdin,
int fdout,
int fderr,
char **envlist)
65 int pin[2], pout[2], perr[2], pid;
133 else if (fdout != -1)
145 else if (fderr != -1)
151 execle(
EXEC_SHELL,
"sh",
"-c", cmd, NULL, envlist);
182 *fp_out = fdopen(pout[0],
"r");
188 *fp_in = fdopen(pin[1],
"w");
194 *fp_err = fdopen(perr[0],
"r");
209pid_t
filter_create(
const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err,
char **envlist)
224 waitpid(pid, &rc, 0);
226 rc = WIFEXITED(rc) ? WEXITSTATUS(rc) : -1;
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
pid_t filter_create_fd(const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err, int fdin, int fdout, int fderr, char **envlist)
Run a command on a pipe (optionally connect stdin/stdout)
pid_t filter_create(const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err, char **envlist)
Set up filter program.
Pass files through external commands (filters)
void mutt_sig_reset_child_signals(void)
Reset ignored signals back to the default.
void mutt_sig_block_system(void)
Block signals before calling exec()
void mutt_sig_unblock_system(bool restore)
Restore previously blocked signals.