|
From: Dave H. <hel...@us...> - 2012-12-04 15:11:50
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCC - Small Footprint CIM Client".
The branch, master has been updated
via b5fec238086b738525264ab96df4710ac28b0aeb (commit)
from 1698d26dfb0ffb8ed451ccbf2310973a7150dcc9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b5fec238086b738525264ab96df4710ac28b0aeb
Author: Dave Heller <hel...@us...>
Date: Tue Dec 4 10:08:54 2012 -0500
[ 3586680 ] improve error reporting in cmciConnect2
-----------------------------------------------------------------------
Summary of changes:
diff --git a/NEWS b/NEWS
index b47e19e..d586380 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Bugs:
- 3547832: memory leak in backend/cimxml/grammer.c
- 3555103: wrong declaration of release attribute in _CIMCArgsFT
- 3566968: sfcc enumInstances fails to parse the xml
+- 3586680: improve error reporting in cmciConnect2
Changes in 2.2.3
================
diff --git a/contributions.txt b/contributions.txt
index 3629fae..c08b7e1 100644
--- a/contributions.txt
+++ b/contributions.txt
@@ -39,6 +39,7 @@ Klaus Kampf, Novell
03/23/2011 [ 2990315 ] cmciRelease not called in case of error
04/25/2011 [ 2967265 ] code cleanup in sfcclient
05/29/2012 [ 3528819 ] Crash in getInstance when instance has NULL properties
+12/04/2012 [ 3586680 ] improve error reporting in cmciConnect2
Suresh Sundriyal, VMWare
------------------------
diff --git a/frontend/sfcc/sfcclient.c b/frontend/sfcc/sfcclient.c
index 2eed047..adbe355 100644
--- a/frontend/sfcc/sfcclient.c
+++ b/frontend/sfcc/sfcclient.c
@@ -76,10 +76,11 @@ CMCIClient *cmciConnect2(const char *hn, const char *scheme, const char *port,
CMPIStatus *rc)
{
CMCIClient *cc = NULL;
- char *msg;
+ char *msg = NULL;
int retc = 0;
char *client;
+ if (rc) rc->rc = CMPI_RC_OK;
pthread_mutex_lock(&ConnectionControl.ccMux);
if (ConnectionControl.ccCount == 0) {
client = getenv("SFCC_CLIENT");
@@ -94,8 +95,15 @@ CMCIClient *cmciConnect2(const char *hn, const char *scheme, const char *port,
}
if (retc || ConnectionControl.ccEnv == NULL) {
if(rc) {
- rc->rc=CMPI_RC_ERR_FAILED;
- rc->msg=NULL;
+ rc->rc = CMPI_RC_ERR_FAILED;
+ if (msg) {
+ fprintf(stderr, "sfcc: NewCIMCEnv failed: %s\n", msg);
+ free(msg);
+ }
+ else {
+ fprintf(stderr, "sfcc: NewCIMCEnv failed without message\n");
+ }
+ rc->msg = NULL; /* Can't create CMPIString without ConnectionControl.ccEnv ! */
}
cc=NULL;
} else {
@@ -113,8 +121,10 @@ CMCIClient *cmciConnect2(const char *hn, const char *scheme, const char *port,
/* cleanup ccEnv after pthread_mutex_unlock */
cmciRelease(NULL);
if (rc) {
- rc->rc = CMPI_RC_ERR_FAILED;
- rc->msg = NULL;
+ if (rc->rc == CMPI_RC_OK)
+ rc->rc = CMPI_RC_ERR_FAILED;
+ if (rc->msg == NULL && ConnectionControl.ccEnv != NULL)
+ rc->msg = native_new_CMPIString("Connection failed", NULL);
}
}
hooks/post-receive
--
SFCC - Small Footprint CIM Client
|