windows-locking-error-codes-20051018

cm_Lock(), cm_RetryLock() should not interpret servers be unreachable as
a sharing violation.
This commit is contained in:
Jeffrey Altman 2005-10-18 21:52:47 +00:00
parent a923af2726
commit 9f0f50a2b1

View File

@ -300,8 +300,19 @@ long cm_CheckOpen(cm_scache_t *scp, int openMode, int trunc, cm_user_t *userp,
if (code == CM_ERROR_NOACCESS &&
!(rights & PRSFS_WRITE))
code = 0;
else
code = CM_ERROR_SHARING_VIOLATION;
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:
code = CM_ERROR_SHARING_VIOLATION;
}
}
}
}
@ -377,8 +388,19 @@ long cm_CheckNTOpen(cm_scache_t *scp, unsigned int desiredAccess,
if (code == CM_ERROR_NOACCESS &&
!(rights & PRSFS_WRITE))
code = 0;
else
code = CM_ERROR_SHARING_VIOLATION;
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:
code = CM_ERROR_SHARING_VIOLATION;
}
}
}
}