summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:00:04 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:44:03 +0530
commit2763f86eea23898501c5299f58edc37e2c1262e5 (patch)
tree750c601e46e7da680feb3a3c6659dfe670c7b804 /booster
parenta35a80b79702d3a81a9d62fc200ae61c6ec67b74 (diff)
booster: Clean-up pread
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 6b842408eeb..81c60574665 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -701,12 +701,13 @@ pread (int fd, void *buf, size_t count, unsigned long offset)
glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd);
if (!glfs_fd) {
- ret = real_pread (fd, buf, count, offset);
+ if (real_pread == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_pread (fd, buf, count, offset);
} else {
ret = glusterfs_pread (glfs_fd, buf, count, offset);
- if (ret == -1) {
- ret = real_pread (fd, buf, count, offset);
- }
booster_put_glfs_fd (glfs_fd);
}