diff mbox

[01/13] nsdbparams: Improve certfile debugging messages

Message ID 20130108172714.65133.85057.stgit@seurat.1015granger.net
State Accepted
Headers show

Commit Message

Chuck Lever Jan. 8, 2013, 5:27 p.m. UTC
Report specific error conditions when reading a certfile fails.

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

 src/libnsdb/nsdb.c      |    2 ++
 src/nsdbparams/update.c |    8 +++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/src/libnsdb/nsdb.c b/src/libnsdb/nsdb.c
index 20d9e55..3f10c4d 100644
--- a/src/libnsdb/nsdb.c
+++ b/src/libnsdb/nsdb.c
@@ -515,6 +515,8 @@  nsdb_read_certfile(const char *pathname, char **certdata,
 		goto out;
 	}
 
+	xlog(D_CALL, "%s: Successfully read %s", __func__, pathname);
+
 	(void)close(fd);
 	*certdata = buf;
 	*certlen = stb.st_size;
diff --git a/src/nsdbparams/update.c b/src/nsdbparams/update.c
index d073552..c436876 100644
--- a/src/nsdbparams/update.c
+++ b/src/nsdbparams/update.c
@@ -363,9 +363,11 @@  nsdbparams_update(const char *progname, int argc, char **argv)
 			goto out;
 		}
 
-		if (nsdb_read_certfile(certfile, &secdata.data,
-				&secdata.len) != FEDFS_OK) {
-			xlog(L_ERROR, "Failed to read certfile");
+		retval = nsdb_read_certfile(certfile,
+						&secdata.data, &secdata.len);
+		if (retval != FEDFS_OK) {
+			xlog(L_ERROR, "Failed to read certfile: %s",
+					nsdb_display_fedfsstatus(retval));
 			goto out;
 		}
 	}