[CRIU] [PATCH 08/12] page-xfer: Use send_psi everywhere
Pavel Emelyanov
xemul at virtuozzo.com
Wed Jun 28 16:47:46 MSK 2017
There are two places left that send ps_iov by hands into
socket. Switch it to use common helper.
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/page-xfer.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index e2c4e10..ea38172 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -513,10 +513,8 @@ static int check_parent_server_xfer(int fd_type, long id)
pi.cmd = PS_IOV_PARENT;
pi.dst_id = encode_pm_id(fd_type, id);
- if (write(page_server_sk, &pi, sizeof(pi)) != sizeof(pi)) {
- pr_perror("Can't write to page server");
+ if (send_psi(page_server_sk, &pi))
return -1;
- }
tcp_nodelay(page_server_sk, true);
@@ -1028,10 +1026,8 @@ int disconnect_from_page_server(void)
else
pi.cmd = PS_IOV_FLUSH;
- if (write(page_server_sk, &pi, sizeof(pi)) != sizeof(pi)) {
- pr_perror("Can't write the fini command to server");
+ if (send_psi(page_server_sk, &pi))
goto out;
- }
if (read(page_server_sk, &status, sizeof(status)) != sizeof(status)) {
pr_perror("The page server doesn't answer");
--
2.1.4
More information about the CRIU
mailing list