}
st->buff->size=0;
} else if (outputchr != OUTPUT_NOTHING) {
- if (st->buff->size < st->buff->len) {
+ if (buf_remaining_space(st->buff)) {
buf_append_uint8(st->buff,outputchr);
} else {
Message(M_WARNING, "userv_afterpoll: dropping overlong"
dup2(st->in,0);
dup2(st->out,1);
- /* XXX close all other fds */
setsid();
/* XXX We really should strdup() all of argv[] but because we'll just
exit anyway if execvp() fails it doesn't seem worth bothering. */
st->slip.pending_esc=False;
/* Invoke userv */
- if (pipe(c_stdin)!=0) {
- fatal_perror("userv_invoke_userv: pipe(c_stdin)");
- }
- if (pipe(c_stdout)!=0) {
- fatal_perror("userv_invoke_userv: pipe(c_stdout)");
- }
+ pipe_cloexec(c_stdin);
+ pipe_cloexec(c_stdout);
st->txfd=c_stdin[1];
st->rxfd=c_stdout[0];