From a2fa3ba3f6b604b9a5b305092226b12e812fcaf1 Mon Sep 17 00:00:00 2001 From: Nandaja Varma Date: Wed, 4 Feb 2015 14:47:36 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9577 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli') 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); -- cgit