diff options
Diffstat (limited to 'booster')
-rw-r--r-- | booster/src/booster.c | 11 |
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); } |