2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

tcp: don't fail if send eats only a part of data

For stream sockets it's possiable and we should not fail in this case.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2014-11-26 22:30:00 +03:00
committed by Pavel Emelyanov
parent 0c33452723
commit 0fc19cf7d2

View File

@@ -472,13 +472,13 @@ static int __send_tcp_queue(int sk, int queue, u32 len, struct cr_img *img)
int chunk = (len > max ? max : len);
ret = send(sk, buf + off, chunk, 0);
if (ret != chunk) {
if (ret <= 0) {
pr_perror("Can't restore %d queue data (%d), want (%d:%d)",
queue, ret, chunk, len);
goto err;
}
off += chunk;
len -= chunk;
off += ret;
len -= ret;
}
err = 0;