From patchwork Thu Jan 2 20:29:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 306277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 97F2F2C0092 for ; Fri, 3 Jan 2014 07:29:15 +1100 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s02KTC19018655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Jan 2014 20:29:13 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s02KTCBo021742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Jan 2014 20:29:12 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1VyotE-0006pI-27; Thu, 02 Jan 2014 12:29:12 -0800 Received: from ucsinet21.oracle.com ([156.151.31.93]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Vyot7-0006ow-Fn for fedfs-utils-devel@oss.oracle.com; Thu, 02 Jan 2014 12:29:05 -0800 Received: from userp1030.oracle.com (userp1030.oracle.com [156.151.31.80]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s02KT4DM024186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Jan 2014 20:29:05 GMT Received: from mail-yh0-f51.google.com (mail-yh0-f51.google.com [209.85.213.51]) by userp1030.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s02KT3Jc013543 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 2 Jan 2014 20:29:04 GMT Received: by mail-yh0-f51.google.com with SMTP id c41so2949628yho.24 for ; Thu, 02 Jan 2014 12:29:03 -0800 (PST) X-Received: by 10.236.158.226 with SMTP id q62mr59568443yhk.2.1388694543535; Thu, 02 Jan 2014 12:29:03 -0800 (PST) Received: from seurat.1015granger.net ([2604:8800:100:81fc:20c:29ff:fe44:ec31]) by mx.google.com with ESMTPSA id o27sm78497362yhb.19.2014.01.02.12.29.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jan 2014 12:29:03 -0800 (PST) To: fedfs-utils-devel@oss.oracle.com From: Chuck Lever Date: Thu, 02 Jan 2014 15:29:02 -0500 Message-ID: <20140102202902.2964.11581.stgit@seurat.1015granger.net> In-Reply-To: <20140102202359.2964.95143.stgit@seurat.1015granger.net> References: <20140102202359.2964.95143.stgit@seurat.1015granger.net> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=209.85.213.51 ct-class=R5 ct-vol1=-92 ct-vol2=7 ct-vol3=7 ct-risk=54 ct-spam1=87 ct-spam2=7 ct-bulk=2 rcpts=1 size=15828 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=E5H0+8tl c=1 sm=1 tr=0 a=x49FHliA+Ap1NUA8iu/DWQ==:117 a=dzsqy3y4QnMA:10 a=g6OnpeLbgzAA:10 a=dPGociXpb70A:10 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=yPCof4ZbAAAA:8 a=Lb1rMZzfAAAA:8 a=1XWaLZrsAAAA:8 a=u9FHgAu2rf8A:10 a=XNrXxkIVvRC76 IE4EMQA:9 a=rdwtgwoKYiN5YtE-:21 a=aYEKj9uqCMBBeTJo:21 a=QEXdDO2ut3YA:10 a=7DSvI1NPTFQA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090204.52C5CC10.00F4, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [fedfs-utils] [PATCH 15/17] libnsdb: switch L_ERROR to D_GENERAL X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] As a general rule, libraries should not emit error messages of any kind. A library should depend on its consumer to present errors to users. Remove log messages for invalid function parameters. Signed-off-by: Chuck Lever --- src/libnsdb/administrator.c | 124 +++++++++++-------------------------------- src/libnsdb/fileserver.c | 84 +++++++---------------------- src/libnsdb/ldap.c | 16 +----- src/libnsdb/path.c | 16 +----- 4 files changed, 60 insertions(+), 180 deletions(-) diff --git a/src/libnsdb/administrator.c b/src/libnsdb/administrator.c index 86d85cf..29a7a92 100644 --- a/src/libnsdb/administrator.c +++ b/src/libnsdb/administrator.c @@ -273,20 +273,14 @@ FedFsStatus nsdb_create_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, const unsigned int ttl) { - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL || fsn_uuid == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL || fsn_uuid == NULL) return FEDFS_ERR_INVAL; - } return nsdb_create_fsn_add_entry(host, nce, fsn_uuid, ttl); } @@ -540,20 +534,14 @@ nsdb_delete_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, FedFsStatus retval; char *dn; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL || fsn_uuid == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL || fsn_uuid == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_search_fsn_dn_s(host, nce, fsn_uuid, &dn); if (retval != FEDFS_OK) @@ -883,20 +871,14 @@ nsdb_create_fsls_s(nsdb_t host, const char *nce, struct fedfs_fsl *fsls) struct fedfs_fsl *fsl, *progress; FedFsStatus retval; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(D_GENERAL, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL || fsls == NULL) { - xlog(D_GENERAL, "%s: Invalid parameter", __func__); + if (nce == NULL || fsls == NULL) return FEDFS_ERR_INVAL; - } for (fsl = fsls, progress = NULL; fsl != NULL; @@ -1058,20 +1040,14 @@ nsdb_delete_fsl_s(nsdb_t host, const char *nce, const char *fsl_uuid) FedFsStatus retval; char *dn; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL || fsl_uuid == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL || fsl_uuid == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_search_fsl_dn_s(host, nce, fsl_uuid, &dn); if (retval != FEDFS_OK) @@ -1184,20 +1160,14 @@ nsdb_update_fsl_s(nsdb_t host, const char *nce, const char *fsl_uuid, FedFsStatus retval; char *dn; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL || fsl_uuid == NULL || attribute == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL || fsl_uuid == NULL || attribute == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_search_fsl_dn_s(host, nce, fsl_uuid, &dn); if (retval != FEDFS_OK) @@ -1367,20 +1337,14 @@ nsdb_create_simple_nce_s(nsdb_t host, const char *parent, char **dn) FedFsStatus retval; char *nce; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (parent == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (parent == NULL) return FEDFS_ERR_INVAL; - } if (parent[0] == '\0') retval = nsdb_create_nce_add_top_entry(host, &nce); @@ -1457,20 +1421,14 @@ nsdb_update_nci_s(nsdb_t host, const char *nce) FedFsStatus retval; char *context; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_find_naming_context_s(host, nce, &context); if (retval != FEDFS_OK) @@ -1571,20 +1529,14 @@ nsdb_remove_nci_s(nsdb_t host, const char *nce) FedFsStatus retval; char *context; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_find_naming_context_s(host, nce, &context); if (retval != FEDFS_OK) @@ -1720,20 +1672,14 @@ nsdb_delete_nsdb_s(nsdb_t host, const char *nce) { FedFsStatus retval; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (nce == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (nce == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_remove_nci_s(host, nce); if (retval != FEDFS_OK) @@ -1767,15 +1713,11 @@ nsdb_attr_add_s(nsdb_t host, const char *dn, const char *attr, { struct berval bval; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } if (value == NULL) return FEDFS_ERR_INVAL; @@ -1815,15 +1757,11 @@ nsdb_attr_delete_s(nsdb_t host, const char *dn, const char *attr, { struct berval bval; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } if (value == NULL) return nsdb_delete_attribute_all_s(host->fn_ldap, dn, diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c index db443a6..7c96c4e 100644 --- a/src/libnsdb/fileserver.c +++ b/src/libnsdb/fileserver.c @@ -601,20 +601,14 @@ nsdb_get_ncedn_s(nsdb_t host, const char *naming_context, char **dn) { FedFsStatus retval; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (dn == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (dn == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_new_get_ncedn_s(host, naming_context, dn); if (retval != FEDFS_OK) @@ -723,20 +717,14 @@ nsdb_get_naming_contexts_s(nsdb_t host, char ***contexts) int entries; char **tmp; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (contexts == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (contexts == NULL) return FEDFS_ERR_INVAL; - } host->fn_ldaperr = nsdb_search_nsdb_attr_s(ld, LDAP_ROOT_DSE, "(objectClass=*)", @@ -1287,20 +1275,14 @@ nsdb_resolve_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, FedFsStatus retval; int i, j; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (fsls == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (fsls == NULL) return FEDFS_ERR_INVAL; - } if (nce != NULL) return nsdb_resolve_fsn_find_entry_s(host, nce, @@ -1599,20 +1581,14 @@ nsdb_get_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, FedFsStatus retval; int i, j; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (fsn == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (fsn == NULL) return FEDFS_ERR_INVAL; - } if (nce != NULL) return nsdb_get_fsn_find_entry_s(host, nce, fsn_uuid, fsn); @@ -1852,20 +1828,14 @@ nsdb_list_s(nsdb_t host, const char *nce, char ***fsns) FedFsStatus retval; int i, j; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (fsns == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (fsns == NULL) return FEDFS_ERR_INVAL; - } if (nce != NULL) return nsdb_list_find_entries_s(host, nce, fsns); @@ -1960,15 +1930,11 @@ nsdb_ping_nsdb_s(nsdb_t host) FedFsStatus retval; char **contexts = NULL; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_get_naming_contexts_s(host, &contexts); if (retval != FEDFS_OK) @@ -1999,10 +1965,8 @@ nsdb_ping_s(const char *hostname, const unsigned short port, FedFsStatus retval; nsdb_t host; - if (ldap_err == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (ldap_err == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_new_nsdb(hostname, port, &host); if (retval != FEDFS_OK) @@ -2083,20 +2047,14 @@ nsdb_find_naming_context_s(nsdb_t host, const char *entry, char **context) char **contexts = NULL; FedFsStatus retval; - if (host == NULL) { - xlog(L_ERROR, "%s: Invalid host parameter", __func__); + if (host == NULL) return FEDFS_ERR_INVAL; - } - if (host->fn_ldap == NULL) { - xlog(L_ERROR, "%s: NSDB not open", __func__); + if (host->fn_ldap == NULL) return FEDFS_ERR_INVAL; - } - if (context == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (context == NULL) return FEDFS_ERR_INVAL; - } retval = nsdb_get_naming_contexts_s(host, &contexts); if (retval != FEDFS_OK) diff --git a/src/libnsdb/ldap.c b/src/libnsdb/ldap.c index 57fbf4a..84a641c 100644 --- a/src/libnsdb/ldap.c +++ b/src/libnsdb/ldap.c @@ -963,10 +963,8 @@ nsdb_compare_dns(LDAPDN dn1, LDAPDN dn2) { int count1, count2; - if (dn1 == NULL || dn2 == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (dn1 == NULL || dn2 == NULL) return false; - } for (count1 = 0; dn1[count1] != NULL; count1++); for (count2 = 0; dn2[count2] != NULL; count2++); @@ -1002,10 +1000,8 @@ nsdb_compare_dn_string(LDAPDN dn1, const char *dn2_in, result = false; - if (dn1 == NULL || dn2_in == NULL || ldap_err == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (dn1 == NULL || dn2_in == NULL || ldap_err == NULL) goto out; - } rc = ldap_str2dn(dn2_in, &dn2, LDAP_DN_FORMAT_LDAPV3); if (rc != LDAP_SUCCESS) { @@ -1043,10 +1039,8 @@ nsdb_compare_dn_strings(const char *dn1_in, const char *dn2_in, result = false; - if (dn1_in == NULL || dn2_in == NULL || ldap_err == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (dn1_in == NULL || dn2_in == NULL || ldap_err == NULL) goto out; - } rc = ldap_str2dn(dn1_in, &dn1, LDAP_DN_FORMAT_LDAPV3); if (rc != LDAP_SUCCESS) { @@ -1115,10 +1109,8 @@ nsdb_dn_ends_with(const char *dn_in, const char *suffix_in, result = false; - if (dn_in == NULL || suffix_in == NULL || ldap_err == NULL) { - xlog(L_ERROR, "%s: Invalid parameter", __func__); + if (dn_in == NULL || suffix_in == NULL || ldap_err == NULL) goto out; - } rc = ldap_str2dn(dn_in, &dn, LDAP_DN_FORMAT_LDAPV3); if (rc != LDAP_SUCCESS) { diff --git a/src/libnsdb/path.c b/src/libnsdb/path.c index 11bf73b..a7cb524 100644 --- a/src/libnsdb/path.c +++ b/src/libnsdb/path.c @@ -273,10 +273,8 @@ nsdb_path_array_to_posix(char * const *path_array, char **pathname) unsigned int i, count; size_t length, len; - if (path_array == NULL || pathname == NULL) { - xlog(L_ERROR, "%s: Invalid argument", __func__); + if (path_array == NULL || pathname == NULL) return FEDFS_ERR_INVAL; - } if (path_array[0] == NULL) { xlog(D_GENERAL, "%s: Zero-component pathname", __func__); @@ -357,10 +355,8 @@ nsdb_posix_to_path_array(const char *pathname, char ***path_array) unsigned int i, count; size_t length; - if (pathname == NULL || path_array == NULL) { - xlog(L_ERROR, "%s: Invalid argument", __func__); + if (pathname == NULL || path_array == NULL) return FEDFS_ERR_INVAL; - } if (!nsdb_pathname_is_utf8(pathname)) { xlog(D_GENERAL, "%s: Bad character in pathname", __func__); @@ -433,10 +429,8 @@ nsdb_path_array_to_fedfspathname(char * const *path_array, FedFsPathName *fpath) size_t length, len; char *component; - if (path_array == NULL || fpath == NULL) { - xlog(L_ERROR, "%s: Invalid argument", __func__); + if (path_array == NULL || fpath == NULL) return FEDFS_ERR_INVAL; - } /* The path "/" MUST be encoded as an array with zero components. */ if (path_array[0] == NULL) { @@ -522,10 +516,8 @@ nsdb_fedfspathname_to_path_array(FedFsPathName fpath, char ***path_array) unsigned int i, len; size_t length; - if (path_array == NULL) { - xlog(L_ERROR, "%s: Invalid argument", __func__); + if (path_array == NULL) return FEDFS_ERR_INVAL; - } if (fpath.FedFsPathName_len == 0) return nsdb_alloc_zero_component_pathname(path_array);