gluster-cli : Fixing "argument can't be negative" coverity issue.
Here value of fd can never have a negative value if it is to be closed. So changing the check from if (fd) to if (fd >= 0) Coverity CIDs: 1124652 1124653 Change-Id: I8491afa93bab10acd2c2e01993a7f7468ca9ff87 BUG: 789278 Signed-off-by: Nandaja Varma <nvarma@redhat.com> Reviewed-on: http://review.gluster.org/9577 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
parent
10f3289bac
commit
a2fa3ba3f6
@ -4760,7 +4760,7 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
|
||||
cli_out ("Common secret pub file present at %s", common_pem_file);
|
||||
ret = 0;
|
||||
out:
|
||||
if (fd)
|
||||
if (fd >= 0)
|
||||
close (fd);
|
||||
|
||||
gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
||||
|
Loading…
x
Reference in New Issue
Block a user