From: Jeffrey Altman Date: Tue, 12 Feb 2013 21:32:18 +0000 (-0500) Subject: Windows: cm_BPlusDirNextEnumEntry return all errors X-Git-Tag: openafs-stable-1_8_0pre1~1544 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=3eb7c4f42946b48fc7b63c9caf8e3e262ca9f88f Windows: cm_BPlusDirNextEnumEntry return all errors Return all entries in the directory enumeration regardless of any errors returned from cm_BPlusDirEnumBulkStatNext(). Set the error code in the returned cm_direnum_entry_t.errorCode field so that the caller can determine how the error should be handled on a per entry basis. Change-Id: I90a90ab0b0220c8d1e045f9473f5edd0bd01e45e Reviewed-on: http://gerrit.openafs.org/9103 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_btree.c b/src/WINNT/afsd/cm_btree.c index fc1b9d4..3550eb1 100644 --- a/src/WINNT/afsd/cm_btree.c +++ b/src/WINNT/afsd/cm_btree.c @@ -2719,7 +2719,7 @@ cm_BPlusDirEnumBulkStatNext(cm_direnum_t *enump) long cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp) { - long code; + long code = 0; if (enump == NULL || entrypp == NULL || enump->next >= enump->count) { if (entrypp) @@ -2731,8 +2731,6 @@ cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp) if (enump->fetchStatus && !(enump->entry[enump->next].flags & CM_DIRENUM_FLAG_GOT_STATUS)) { code = cm_BPlusDirEnumBulkStatNext(enump); - if (code) - return code; } *entrypp = &enump->entry[enump->next++]; @@ -2741,7 +2739,12 @@ cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp) return CM_ERROR_STOPNOW; } else { - osi_Log0(afsd_logp, "cm_BPlusDirNextEnumEntry SUCCESS"); + if (code) { + (*entrypp)->errorCode = code; + osi_Log1(afsd_logp, "cm_BPlusDirNextEnumEntry ERROR 0x%x", code); + } else { + osi_Log0(afsd_logp, "cm_BPlusDirNextEnumEntry SUCCESS"); + } return 0; } }