summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-journal-handler.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
index f2fc25cc671..a2d75cbbbfd 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
+++ b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
@@ -503,8 +503,9 @@ gf_changelog_decode (xlator_t *this, gf_changelog_journal_t *jnl,
/**
* start processing after the header
*/
- sys_lseek (from_fd, elen, SEEK_SET);
-
+ if (sys_lseek (from_fd, elen, SEEK_SET) < 0) {
+ goto out;
+ }
switch (encoding) {
case CHANGELOG_ENCODE_BINARY:
/**
@@ -525,7 +526,7 @@ gf_changelog_decode (xlator_t *this, gf_changelog_journal_t *jnl,
ret = gf_changelog_copy (this, from_fd, to_fd);
}
- out:
+out:
return ret;
}