@@ -201,19 +201,24 @@ fedfs_lookup_junction_print_resok(FedFsLookupResOk result)
}
static void
-fedfs_lookup_junction_print_result(FedFsLookupRes result)
+fedfs_lookup_junction_print_ldapresultcode(FedFsLookupRes result)
{
- int ldap_err;
+ int ldap_err = result.FedFsLookupRes_u.ldapResultCode;
+
+ fprintf(stderr, "LDAP result code (%d): %s\n",
+ ldap_err, ldap_err2string(ldap_err));
+}
+static void
+fedfs_lookup_junction_print_result(FedFsLookupRes result)
+{
nsdb_print_fedfsstatus(result.status);
switch (result.status) {
case FEDFS_OK:
fedfs_lookup_junction_print_resok(result.FedFsLookupRes_u.resok);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
- ldap_err = result.FedFsLookupRes_u.ldapResultCode;
- fprintf(stderr, "LDAP result code (%d): %s\n",
- ldap_err, ldap_err2string(ldap_err));
+ fedfs_lookup_junction_print_ldapresultcode(result);
break;
default:
break;
@@ -204,9 +204,10 @@ fedfs_lookup_replication_print_resok(FedFsLookupResOk result)
static void
fedfs_lookup_replication_print_ldapresultcode(FedFsLookupRes result)
{
- int ldap_result = result.FedFsLookupRes_u.ldapResultCode;
- printf("LDAP result code (%d): %s\n",
- ldap_result, ldap_err2string(ldap_result));
+ int ldap_err = result.FedFsLookupRes_u.ldapResultCode;
+
+ fprintf(stderr, "LDAP result code (%d): %s\n",
+ ldap_err, ldap_err2string(ldap_err));
}
static void
Clean up: code in fedfs-lookup-junction and fedfs-lookup-replication to display LDAP errors should be consistent. Both should display the error on stderr. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- src/fedfsc/fedfs-lookup-junction.c | 15 ++++++++++----- src/fedfsc/fedfs-lookup-replication.c | 7 ++++--- 2 files changed, 14 insertions(+), 8 deletions(-)