2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

page-xfer: print error message if splice failed

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2014-02-04 18:29:21 +04:00 committed by Pavel Emelyanov
parent 8a6c150223
commit 3929c853dd

View File

@ -473,8 +473,16 @@ static int write_pagemap_loc(struct page_xfer *xfer,
static int write_pages_loc(struct page_xfer *xfer,
int p, unsigned long len)
{
if (splice(p, NULL, xfer->fd_pg, NULL, len, SPLICE_F_MOVE) != len)
ssize_t ret;
ret = splice(p, NULL, xfer->fd_pg, NULL, len, SPLICE_F_MOVE);
if (ret == -1) {
pr_perror("Unable to spice data");
return -1;
}
if (ret != len) {
pr_err("Only %lu of %lu bytes have been spliced\n", ret, len);
return -1;
}
return 0;
}