From de27a7c656fbcd3720984313336ae563cae464e9 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Tue, 30 Jan 2018 18:41:20 +0300 Subject: [PATCH] unix: Move post_open_unix_sk() to open_unixsk_standalone() and rename it Since this function is used by standalone sockets only, we move it to appropriate place. No functional changes. Signed-off-by: Kirill Tkhai Signed-off-by: Andrei Vagin --- criu/sk-unix.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/criu/sk-unix.c b/criu/sk-unix.c index 87f292965..77f32dc39 100644 --- a/criu/sk-unix.c +++ b/criu/sk-unix.c @@ -1088,7 +1088,7 @@ err: return -1; } -static int post_open_unix_sk(struct file_desc *d, int fd) +static int post_open_standalone(struct file_desc *d, int fd) { struct unix_sk_info *ui; struct unix_sk_info *peer; @@ -1308,10 +1308,14 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui, int *new_fd) static int open_unixsk_standalone(struct unix_sk_info *ui, int *new_fd) { + struct fdinfo_list_entry *fle; int sk; pr_info("Opening standalone socket (id %#x ino %#x peer %#x)\n", ui->ue->id, ui->ue->ino, ui->ue->peer); + fle = file_master(&ui->d); + if (fle->stage == FLE_OPEN) + return post_open_standalone(&ui->d, fle->fe->fd); if (set_netns(ui->ue->ns_id)) return -1; @@ -1459,7 +1463,6 @@ out: static int open_unix_sk(struct file_desc *d, int *new_fd) { - struct fdinfo_list_entry *fle; struct unix_sk_info *ui; int ret; @@ -1471,10 +1474,6 @@ static int open_unix_sk(struct file_desc *d, int *new_fd) return 1; } - fle = file_master(d); - if (fle->stage >= FLE_OPEN) - return post_open_unix_sk(d, fle->fe->fd); - if (inherited_fd(d, new_fd)) { ui->ue->uflags |= USK_INHERIT; ret = *new_fd >= 0 ? 0 : -1;