summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 1392f4b..e0fdc6a 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -3613,7 +3613,7 @@ int
libgf_client_read (libglusterfs_client_ctx_t *ctx, fd_t *fd, void *buf,
size_t size, off_t offset)
{
- int32_t op_ret = -1;
+ int32_t op_ret = -1, ret = 0;
size_t tmp = 0;
while (size != 0) {
@@ -3627,9 +3627,10 @@ libgf_client_read (libglusterfs_client_ctx_t *ctx, fd_t *fd, void *buf,
size -= op_ret;
offset += op_ret;
buf = (char *)buf + op_ret;
+ ret += op_ret;
}
- return op_ret;
+ return ret;
}
ssize_t
@@ -3757,7 +3758,7 @@ ssize_t
libgf_client_readv (libglusterfs_client_ctx_t *ctx, fd_t *fd,
const struct iovec *dst_vector, int dst_count, off_t offset)
{
- int32_t op_ret = -1;
+ int32_t op_ret = -1, ret = 0;
size_t size = 0, tmp = 0;
int i = 0;
int dst_idx = 0;
@@ -3779,9 +3780,10 @@ libgf_client_readv (libglusterfs_client_ctx_t *ctx, fd_t *fd,
offset += op_ret;
size -= op_ret;
+ ret += op_ret;
}
- return op_ret;
+ return ret;
}