Commit 69b8cac2 authored by Pavel Emelyanov's avatar Pavel Emelyanov

util: Rename move_img_fd

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 09cee18a
......@@ -887,7 +887,7 @@ static int send_fd_to_self(int fd, struct fdinfo_list_entry *fle, int *sock)
return -1;
pr_info("\t\t\tGoing to dup %d into %d\n", fd, dfd);
if (move_img_fd(sock, dfd))
if (move_fd_from(sock, dfd))
return -1;
if (dup2(fd, dfd) != dfd) {
......
......@@ -50,7 +50,7 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area);
} while (0)
#define pr_info_vma_list(head) pr_vma_list(LOG_INFO, head)
extern int move_img_fd(int *img_fd, int want_fd);
extern int move_fd_from(int *img_fd, int want_fd);
extern int close_safe(int *fd);
extern int reopen_fd_as_safe(char *file, int line, int new_fd, int old_fd, bool allow_reuse_fd);
......
......@@ -1267,7 +1267,7 @@ static int tmpfs_dump(struct mount_info *pm)
* non-zero, because cr_system_userns closes STDIN_FILENO as we are not
* interested in passing stdin to tar.
*/
if (move_img_fd(&fd, STDIN_FILENO) < 0)
if (move_fd_from(&fd, STDIN_FILENO) < 0)
goto out;
if (fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) & ~FD_CLOEXEC) == -1) {
......
......@@ -218,7 +218,7 @@ int reopen_fd_as_safe(char *file, int line, int new_fd, int old_fd, bool allow_r
return 0;
}
int move_img_fd(int *img_fd, int want_fd)
int move_fd_from(int *img_fd, int want_fd)
{
if (*img_fd == want_fd) {
int tmp;
......@@ -621,8 +621,8 @@ int cr_system_userns(int in, int out, int err, char *cmd,
if (out == in)
out = DUP_SAFE(out, out_chld);
if (move_img_fd(&out, STDIN_FILENO) ||
move_img_fd(&err, STDIN_FILENO))
if (move_fd_from(&out, STDIN_FILENO) ||
move_fd_from(&err, STDIN_FILENO))
goto out_chld;
if (in < 0) {
......@@ -632,7 +632,7 @@ int cr_system_userns(int in, int out, int err, char *cmd,
goto out_chld;
}
if (move_img_fd(&err, STDOUT_FILENO))
if (move_fd_from(&err, STDOUT_FILENO))
goto out_chld;
if (reopen_fd_as_nocheck(STDOUT_FILENO, out))
......
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