diff options
author | Vishal Pandey <vishpandey2014@gmail.com> | 2017-09-25 12:14:33 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-11-08 02:17:08 +0000 |
commit | ea6b6461f34332cede200cdbcba299f1de69ba12 (patch) | |
tree | 5e785f65fe43ad663d02ce2e13b546d2e0178680 | |
parent | 098c8031823d79096c9a8e240d36415aed178930 (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>
-rw-r--r-- | xlators/features/changelog/lib/src/gf-changelog-journal-handler.c | 7 |
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; } |