mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
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 <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
8377abeb1f
commit
de27a7c656
1 changed files with 5 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue