summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:00:56 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:44:44 +0530
commit83ae751616ce18d3010664f13ac8b8ecf8dd313d (patch)
tree31d7783be94a52db59fa8983f901c96ba3c130a4 /booster
parent00b1e268fb0d3696820bd2e849c42deebe80a3cd (diff)
booster: Clean-up pwrite64
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 912c3291ed7..e0fa8e527ae 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -857,12 +857,14 @@ pwrite64 (int fd, const void *buf, size_t count, uint64_t offset)
glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd);
if (!glfs_fd) {
- ret = real_pwrite64 (fd, buf, count, offset);
+ if (real_pwrite64 == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_pwrite64 (fd, buf, count, offset);
} else {
ret = glusterfs_pwrite (glfs_fd, buf, count, offset);
- if (ret == -1) {
- ret = real_pwrite64 (fd, buf, count, offset);
- }
+ booster_put_glfs_fd (glfs_fd);
}
return ret;