Close pipefd[1] before reading from pipefd[0]
This commit is contained in:
parent
dcc0565338
commit
b01eb30f6b
@ -225,13 +225,13 @@ void subprocRunChild(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_er
|
||||
|
||||
char log_buf[4096];
|
||||
|
||||
close(pipefd[1]);
|
||||
ssize_t sz;
|
||||
while ((sz = read(pipefd[0], log_buf, sizeof(log_buf) - 1)) > 0) {
|
||||
log_buf[sz] = '\0';
|
||||
logDirectlyToFD(log_buf);
|
||||
}
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
|
||||
subprocAdd(nsjconf, pid, fd_in);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user