mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +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:
committed by
Pavel Emelyanov
parent
8a6c150223
commit
3929c853dd
10
page-xfer.c
10
page-xfer.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user