Patchwork [2/4] libnsdb: Initialize fn_sectype field in nsdb_new_nsdb()

login
register
mail settings
Submitter Chuck Lever
Date Jan. 8, 2013, 5:30 p.m.
Message ID <20130108173036.65331.29150.stgit@seurat.1015granger.net>
Download mbox | patch
Permalink /patch/210459/
State Accepted
Headers show

Comments

Chuck Lever - Jan. 8, 2013, 5:30 p.m.
API clean up: Initialize the sectype field in an obvious place that
others may re-use reliably.

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

 src/libnsdb/fileserver.c |    1 -
 src/libnsdb/nsdb.c       |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c
index 362e056..56837a8 100644
--- a/src/libnsdb/fileserver.c
+++ b/src/libnsdb/fileserver.c
@@ -1827,7 +1827,6 @@  nsdb_ping_s(const char *hostname, const unsigned short port,
 	retval = nsdb_new_nsdb(hostname, port, &host);
 	if (retval != FEDFS_OK)
 		return retval;
-	host->fn_sectype = FEDFS_SEC_NONE;
 
 	retval = nsdb_open_nsdb(host, NULL, NULL, ldap_err);
 	if (retval != FEDFS_OK)
diff --git a/src/libnsdb/nsdb.c b/src/libnsdb/nsdb.c
index 888c6a5..dcea59e 100644
--- a/src/libnsdb/nsdb.c
+++ b/src/libnsdb/nsdb.c
@@ -483,6 +483,7 @@  nsdb_new_nsdb(const char *hostname, const unsigned long port, nsdb_t *host)
 	memset(*host, 0, sizeof(**host));
 	(*host)->fn_hostname = hostname_tmp;
 	(*host)->fn_port = port_tmp;
+	(*host)->fn_sectype = FEDFS_SEC_NONE;
 	return FEDFS_OK;
 }