summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorM. Mohan Kumar <mohan@in.ibm.com>2013-11-15 17:50:34 +0530
committerVijay Bellur <vbellur@redhat.com>2013-11-19 09:57:37 -0800
commit1ef8a597db1ead482612f2f0bcc212d9a1349ccb (patch)
tree0b6c62a423078e18ae3fa9bd217cabda38a82df9 /xlators/storage/posix/src/posix.c
parentf9443a3f148dde4bb1a628184140d59f45db64a2 (diff)
Fixes for ZF reported by coverity
BUG: 1028673 Change-Id: I7c75738cca22c81c5629d579ef5bea24000e622e Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Reviewed-on: http://review.gluster.org/6291 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 768ab4929..de7854205 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -686,7 +686,11 @@ _posix_do_zerofill(int fd, off_t offset, off_t len, int o_direct)
vector[idx].iov_base = iov_base;
vector[idx].iov_len = vect_size;
}
- lseek(fd, offset, SEEK_SET);
+ if (lseek(fd, offset, SEEK_SET) < 0) {
+ op_ret = -1;
+ goto err;
+ }
+
for (idx = 0; idx < num_loop; idx++) {
op_ret = writev(fd, vector, num_vect);
if (op_ret < 0)