Commit 5498ed17 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

restore: Use close_safe for pipes

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 9212f2e8
......@@ -864,11 +864,11 @@ static int create_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int
pr_info("\t%d: All is ok - reopening pipe for %d\n", pid, e->fd);
if (e->flags & O_WRONLY) {
close(pfd[0]);
tmp = reopen_fd_as(e->fd, pfd[1]);
close_safe(&pi->read_fd);
tmp = reopen_fd_as(e->fd, pi->write_fd);
} else {
close(pfd[1]);
tmp = reopen_fd_as(e->fd, pfd[0]);
close_safe(&pi->write_fd);
tmp = reopen_fd_as(e->fd, pi->read_fd);
}
if (tmp < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment