From: Jeffrey Altman Date: Fri, 19 Aug 2011 01:57:12 +0000 (-0400) Subject: Windows: be explicit when mapping sharing violation X-Git-Tag: upstream/1.8.0_pre1^2~3370 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a576ff1e53a539e88b9f3fa6b8132d4f161b0bd4;p=packages%2Fo%2Fopenafs.git Windows: be explicit when mapping sharing violation Only one lock acquistion failure should be mapping to CM_ERROR_SHARING_VIOLATION. That is CM_ERROR_LOCK_NOT_GRANTED. Make it clear that is what we are doing. Change-Id: Ic1933a989a4e8c95a1417679e9bc7cbc4e14dd12 Reviewed-on: http://gerrit.openafs.org/5299 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 8e4fd1007..5698f0af7 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -159,17 +159,8 @@ long cm_CheckOpen(cm_scache_t *scp, int openMode, int trunc, cm_user_t *userp, !(rights & PRSFS_WRITE)) code = 0; else { - switch (code) { - case CM_ERROR_ALLOFFLINE: - case CM_ERROR_ALLDOWN: - case CM_ERROR_ALLBUSY: - case CM_ERROR_TIMEDOUT: - case CM_ERROR_RETRY: - case CM_ERROR_WOULDBLOCK: - break; - default: + if (code == CM_ERROR_LOCK_NOT_GRANTED) code = CM_ERROR_SHARING_VIOLATION; - } } } @@ -277,17 +268,8 @@ long cm_CheckNTOpen(cm_scache_t *scp, unsigned int desiredAccess, !(rights & PRSFS_WRITE)) code = 0; else { - switch (code) { - case CM_ERROR_ALLOFFLINE: - case CM_ERROR_ALLDOWN: - case CM_ERROR_ALLBUSY: - case CM_ERROR_TIMEDOUT: - case CM_ERROR_RETRY: - case CM_ERROR_WOULDBLOCK: - break; - default: + if (code == CM_ERROR_LOCK_NOT_GRANTED) code = CM_ERROR_SHARING_VIOLATION; - } } } } else if (code != 0) {