summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/src
diff options
context:
space:
mode:
authorVishal Pandey <vishpandey2014@gmail.com>2017-09-25 12:14:33 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-11-08 02:17:08 +0000
commitea6b6461f34332cede200cdbcba299f1de69ba12 (patch)
tree5e785f65fe43ad663d02ce2e13b546d2e0178680 /xlators/features/changelog/lib/src
parent098c8031823d79096c9a8e240d36415aed178930 (diff)
features/changelog: Coverity Error Check Return
If condition to check error in lseek wrapper sys_lseek. Change-Id: Ic96ddbb0898146bbfae11acc86818d6604e5eb98 BUG: 789278 Signed-off-by: Vishal Pandey <vishpandey2014@gmail.com>
Diffstat (limited to 'xlators/features/changelog/lib/src')
-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;
}