summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-05-07 02:51:07 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-08 06:37:50 -0700
commit03edd34d0854accfa5170548dfdb152ac13feba5 (patch)
tree361f91551d0fa6fc4fe75462d7553abdbefb362a /xlators
parent92ad83c99472eb858363fc3bb0aba3ea6fc9ec8b (diff)
storage/posix: Use off_t for return value from lseek()
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 901 (windows iozone causes posix writev to fail) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=901
Diffstat (limited to 'xlators')
-rw-r--r--xlators/storage/posix/src/posix.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 58939f0..0c7890f 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -2449,6 +2449,7 @@ posix_readv (call_frame_t *frame, xlator_t *this,
struct stat stbuf = {0,};
int align = 1;
int ret = -1;
+ off_t off_ret = -1;
VALIDATE_OR_GOTO (frame, out);
VALIDATE_OR_GOTO (this, out);
@@ -2486,8 +2487,9 @@ posix_readv (call_frame_t *frame, xlator_t *this,
_fd = pfd->fd;
- op_ret = lseek (_fd, offset, SEEK_SET);
- if (op_ret == -1) {
+ off_ret = lseek (_fd, offset, SEEK_SET);
+ if (off_ret == -1) {
+ op_ret = -1;
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR,
"lseek(%"PRId64") failed: %s",
@@ -2561,6 +2563,7 @@ posix_writev (call_frame_t *frame, xlator_t *this,
struct stat preop = {0,};
struct stat postop = {0,};
int ret = -1;
+ off_t off_ret = -1;
int idx = 0;
int align = 4096;
@@ -2600,9 +2603,10 @@ posix_writev (call_frame_t *frame, xlator_t *this,
goto out;
}
- op_ret = lseek (_fd, offset, SEEK_SET);
+ off_ret = lseek (_fd, offset, SEEK_SET);
- if (op_ret == -1) {
+ if (off_ret == -1) {
+ op_ret = -1;
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR,
"lseek(%"PRId64") on fd=%p failed: %s",