FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 10-25-2011, 12:09 PM
"Fabio M. Di Nitto"
 
Default config: remove unused var in ccs_tool

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
:100644 100644 a0fee9f... 34c4c1e... M config/tools/ccs_tool/ccs_tool.c
config/tools/ccs_tool/ccs_tool.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/config/tools/ccs_tool/ccs_tool.c b/config/tools/ccs_tool/ccs_tool.c
index a0fee9f..34c4c1e 100644
--- a/config/tools/ccs_tool/ccs_tool.c
+++ b/config/tools/ccs_tool/ccs_tool.c
@@ -9,15 +9,6 @@
#include "ccs.h"


-/*
- * Old libccs retruned -error (mostly!) but didn't set errno (sigh)
- * New libccs sets errno correctly
- */
-static char *errstring(int retcode)
-{
- return strerror(errno);
-}
-
static void tool_print_usage(FILE *stream);

int globalverbose=0;
@@ -27,7 +18,6 @@ static void test_print_usage(FILE *stream);
static int test_main(int argc, char *argv[], int old_format){
int desc=0;
int i=0;
- int error = 0;
int force = 0, blocking = 0;
char *str=NULL;
char *cluster_name = NULL;
@@ -76,7 +66,7 @@ static int test_main(int argc, char *argv[], int old_format){
desc = ccs_connect();
}
if(desc < 0){
- fprintf(stderr, "ccs_connect failed: %s
", errstring(-desc));
+ fprintf(stderr, "ccs_connect failed: %s
", strerror(errno));
exit(EXIT_FAILURE);
} else {
printf("Connect successful.
");
@@ -94,8 +84,8 @@ static int test_main(int argc, char *argv[], int old_format){
fprintf(stderr, "ccs_disconnect failed: unable to communicate with ccs
");
exit(EXIT_FAILURE);
}
- if((error = ccs_disconnect(desc))){
- fprintf(stderr, "ccs_disconnect failed: %s
", errstring(-error));
+ if(ccs_disconnect(desc)){
+ fprintf(stderr, "ccs_disconnect failed: %s
", strerror(errno));
exit(EXIT_FAILURE);
} else {
printf("Disconnect successful.
");
@@ -107,8 +97,8 @@ static int test_main(int argc, char *argv[], int old_format){
exit(EXIT_FAILURE);
}
desc = ccs_connect();
- if((desc < 0) || (error = ccs_get(desc, argv[3], &str))){
- fprintf(stderr, "ccs_get failed: %s
", errstring(-error));
+ if((desc < 0) || ccs_get(desc, argv[3], &str)){
+ fprintf(stderr, "ccs_get failed: %s
", strerror(errno));
exit(EXIT_FAILURE);
} else {
if (old_format) {
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 12:53 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org