Patchwork [09/13] fedfsc: Explicitly report missing NSDB paramaters

login
register
mail settings
Submitter Chuck Lever
Date Feb. 1, 2013, 5:21 p.m.
Message ID <20130201172102.63192.7503.stgit@seurat.1015granger.net>
Download mbox | patch
Permalink /patch/217536/
State Accepted
Headers show

Comments

Chuck Lever - Feb. 1, 2013, 5:21 p.m.
Clean up: code in fedfs-get-limited-nsdb-params and
fedfs-get-nsdb-params should report that the server does not
have the requested connection parameters, rather than just
reporting the error code.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 src/fedfsc/fedfs-get-limited-nsdb-params.c |    5 +++++
 src/fedfsc/fedfs-get-nsdb-params.c         |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

Patch

diff --git a/src/fedfsc/fedfs-get-limited-nsdb-params.c b/src/fedfsc/fedfs-get-limited-nsdb-params.c
index 7bda6eb..7bfb535 100644
--- a/src/fedfsc/fedfs-get-limited-nsdb-params.c
+++ b/src/fedfsc/fedfs-get-limited-nsdb-params.c
@@ -91,6 +91,11 @@  fedfs_get_limited_nsdb_params_print_result(FedFsGetNsdbParamsRes result)
 {
 	FedFsNsdbParams *params = &result.FedFsGetNsdbParamsRes_u.params;
 
+	if (result.status == FEDFS_ERR_NSDB_PARAMS) {
+		printf("No connection parameters found\n");
+		return;
+	}
+
 	nsdb_print_fedfsstatus(result.status);
 	if (result.status != FEDFS_OK)
 		return;
diff --git a/src/fedfsc/fedfs-get-nsdb-params.c b/src/fedfsc/fedfs-get-nsdb-params.c
index b8c7995..459c56d 100644
--- a/src/fedfsc/fedfs-get-nsdb-params.c
+++ b/src/fedfsc/fedfs-get-nsdb-params.c
@@ -95,6 +95,11 @@  fedfs_get_nsdb_params_print_result(FedFsGetNsdbParamsRes result,
 {
 	FedFsNsdbParams *params = &result.FedFsGetNsdbParamsRes_u.params;
 
+	if (result.status == FEDFS_ERR_NSDB_PARAMS) {
+		printf("No connection parameters found\n");
+		return;
+	}
+
 	nsdb_print_fedfsstatus(result.status);
 	if (result.status != FEDFS_OK)
 		return;