Commit dd195109 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

files: Move closing fle's transport_fd to recv_fd_from_peer()

No functional changes

travis-ci: success for Rework file opening scheme to make it asynchronous (rev5)
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent ed55f1dd
...@@ -970,6 +970,7 @@ int recv_fd_from_peer(struct fdinfo_list_entry *fle) ...@@ -970,6 +970,7 @@ int recv_fd_from_peer(struct fdinfo_list_entry *fle)
pr_err("Received wrong fle\n"); pr_err("Received wrong fle\n");
return -1; return -1;
} }
close(fle->fe->fd);
return fd; return fd;
} }
...@@ -1099,7 +1100,6 @@ static int receive_fd(int pid, struct fdinfo_list_entry *fle) ...@@ -1099,7 +1100,6 @@ static int receive_fd(int pid, struct fdinfo_list_entry *fle)
pr_err("Can't get fd %d\n", tmp); pr_err("Can't get fd %d\n", tmp);
return -1; return -1;
} }
close(fle->fe->fd);
if (reopen_fd_as(fle->fe->fd, tmp) < 0) if (reopen_fd_as(fle->fe->fd, tmp) < 0)
return -1; return -1;
......
...@@ -242,7 +242,6 @@ static int recv_pipe_fd(struct pipe_info *pi) ...@@ -242,7 +242,6 @@ static int recv_pipe_fd(struct pipe_info *pi)
pr_err("Can't get fd %d\n", tmp); pr_err("Can't get fd %d\n", tmp);
return -1; return -1;
} }
close(fd);
if (pi->reopen) if (pi->reopen)
fd = reopen_pipe(tmp, pi->pe->flags); fd = reopen_pipe(tmp, pi->pe->flags);
......
...@@ -1102,7 +1102,6 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui) ...@@ -1102,7 +1102,6 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui)
pr_err("Can't recv pair slave\n"); pr_err("Can't recv pair slave\n");
return -1; return -1;
} }
close(fle->fe->fd);
if (bind_unix_sk(sk, ui)) if (bind_unix_sk(sk, ui))
return -1; return -1;
......
...@@ -924,7 +924,6 @@ static int receive_tty(struct tty_info *info) ...@@ -924,7 +924,6 @@ static int receive_tty(struct tty_info *info)
pr_info("\tWaiting tty fd %d (pid %d)\n", fle->fe->fd, fle->pid); pr_info("\tWaiting tty fd %d (pid %d)\n", fle->fe->fd, fle->pid);
fd = recv_fd_from_peer(fle); fd = recv_fd_from_peer(fle);
close(fle->fe->fd);
if (fd < 0) { if (fd < 0) {
pr_err("Can't get fd %d\n", fd); pr_err("Can't get fd %d\n", fd);
return -1; return -1;
......
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