summaryrefslogtreecommitdiffstats
path: root/booster/src
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:00:49 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:44:32 +0530
commit00b1e268fb0d3696820bd2e849c42deebe80a3cd (patch)
tree5adfadfd5a48107c8eae2c98f509781777b7471b /booster/src
parent6696009a6662cc77458246ffc3dccc22f8d6c185 (diff)
booster: Clean-up pwrite
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster/src')
-rw-r--r--booster/src/booster.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 46db2b621a2..912c3291ed7 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -831,17 +831,16 @@ pwrite (int fd, const void *buf, size_t count, unsigned long offset)
int ret;
glusterfs_file_t glfs_fd = 0;
- assert (real_pwrite != NULL);
-
glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd);
if (!glfs_fd) {
- ret = real_pwrite (fd, buf, count, offset);
+ if (real_pwrite == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_pwrite (fd, buf, count, offset);
} else {
ret = glusterfs_pwrite (glfs_fd, buf, count, offset);
- if (ret == -1) {
- ret = real_pwrite (fd, buf, count, offset);
- }
booster_put_glfs_fd (glfs_fd);
}