提交 c6967746 编写于 作者: A Andreas Gruenbacher 提交者: Philipp Reisner

drbd: Add drbd_recv_all(): Receive an entire buffer

Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 a982dd57
......@@ -565,6 +565,19 @@ static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size)
return rv;
}
static int drbd_recv_all(struct drbd_tconn *tconn, void *buf, size_t size)
{
int err;
err = drbd_recv(tconn, buf, size);
if (err != size) {
if (err >= 0)
err = -EIO;
} else
err = 0;
return err;
}
/* quoting tcp(7):
* On individual connections, the socket buffer size must be set prior to the
* listen(2) or connect(2) calls in order to have it take effect.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册