{
int access;
int loopCount = 0;
+ int errnum;
FileIOResult result;
FileLockToken *tokenPtr = Util_SafeMalloc(sizeof *tokenPtr);
lockFile, access,
FILEIO_OPEN_CREATE, 0600,
0);
+ errnum = Err_Errno();
if (result != FILEIO_LOCK_FAILED) {
break;
}
return tokenPtr;
} else {
- *err = FileMapErrorToErrno(__FUNCTION__, Err_Errno());
+ if (result == FILEIO_LOCK_FAILED) {
+ *err = 0;
+ } else {
+ *err = FileMapErrorToErrno(__FUNCTION__, errnum);
+ }
free(tokenPtr->pathName);
ASSERT(!FileIO_IsValid(&tokenPtr->u.mandatory.lockFd));
free(tokenPtr);