From: Liu Yuan Date: Tue, 3 Apr 2012 10:04:21 +0000 (+0800) Subject: sheepdog: fix send req helpers X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~4265^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb09218077a495bc55d84de91f448f72fe78a60b;p=sdk%2Femulator%2Fqemu.git sheepdog: fix send req helpers We should return if reading of the header fails. Cc: Kevin Wolf Cc: MORITA Kazutaka Signed-off-by: Liu Yuan Acked-by: MORITA Kazutaka Signed-off-by: Kevin Wolf --- diff --git a/block/sheepdog.c b/block/sheepdog.c index 1248534..3eaf625 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -510,6 +510,7 @@ static int send_req(int sockfd, SheepdogReq *hdr, void *data, ret = qemu_send_full(sockfd, hdr, sizeof(*hdr), 0); if (ret < sizeof(*hdr)) { error_report("failed to send a req, %s", strerror(errno)); + return ret; } ret = qemu_send_full(sockfd, data, *wlen, 0); @@ -528,6 +529,7 @@ static int send_co_req(int sockfd, SheepdogReq *hdr, void *data, ret = qemu_co_send(sockfd, hdr, sizeof(*hdr)); if (ret < sizeof(*hdr)) { error_report("failed to send a req, %s", strerror(errno)); + return ret; } ret = qemu_co_send(sockfd, data, *wlen);