Commit 70b65c9a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pipes: Don't call for restore_fown if open failed

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 6b06c744
...@@ -181,8 +181,12 @@ static int recv_pipe_fd(struct pipe_info *pi) ...@@ -181,8 +181,12 @@ static int recv_pipe_fd(struct pipe_info *pi)
fd = open(path, pi->pe.flags); fd = open(path, pi->pe.flags);
close(tmp); close(tmp);
if (restore_fown(fd, &pi->pe.fown)) if (fd >= 0) {
return -1; if (restore_fown(fd, &pi->pe.fown)) {
close(fd);
return -1;
}
}
return fd; return fd;
} }
......
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