[CRIU] [PATCH RFC 27/30] files: Set fds event after sending fd to peer
Kirill Tkhai
ktkhai at virtuozzo.com
Tue Nov 1 07:34:42 PDT 2016
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/files.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/criu/files.c b/criu/files.c
index 415476c..1c40b40 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -928,7 +928,7 @@ int recv_fd_from_peer(struct fdinfo_list_entry *fle)
int send_fd_to_peer(int fd, struct fdinfo_list_entry *fle)
{
struct sockaddr_un saddr;
- int len, sock;
+ int len, sock, ret;
sock = get_service_fd(TRANSPORT_FD_OFF);
@@ -936,7 +936,10 @@ int send_fd_to_peer(int fd, struct fdinfo_list_entry *fle)
futex_wait_while(&pstree_item_by_virt(fle->pid)->task_st, TSK_ALLOCATED);
transport_name_gen(&saddr, &len, fle->pid);
pr_info("\t\tSend fd %d to %s\n", fd, saddr.sun_path + 1);
- return send_fds(sock, &saddr, len, &fd, 1, false, (unsigned long *)&fle);
+ ret = send_fds(sock, &saddr, len, &fd, 1, false, (unsigned long *)&fle);
+ if (ret < 0)
+ return -1;
+ return set_fds_event(fle->pid);
}
static int send_fd_to_self(int fd, struct fdinfo_list_entry *fle)
@@ -965,7 +968,7 @@ static int send_fd_to_self(int fd, struct fdinfo_list_entry *fle)
fle->received = 1;
- return 0;
+ return set_fds_event(fle->pid);
}
static int post_open_fd(int pid, struct fdinfo_list_entry *fle)
More information about the CRIU
mailing list