summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorNandaja Varma <nvarma@redhat.com>2015-02-04 14:47:36 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-31 01:05:35 -0700
commita2fa3ba3f6b604b9a5b305092226b12e812fcaf1 (patch)
tree6876c2a9561a895212c16a40567f73b8f6902837 /cli
parent10f3289bac31a2b0020dfe1e97ed98601e4e4521 (diff)
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>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 5471291ab63..3065f64f0eb 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -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);