FileLock_Lock() can return the errno to the caller through int *err.
Before this change, one case is missing: EAGAIN. This change will fix it.
Posix_Free(normalizedPath);
}
- if (err != NULL) {
- *err = res;
- }
-
if (tokenPtr == NULL) {
- int errnoValue;
-
if (res == 0) {
- errnoValue = EAGAIN; // Thank you for playing; try again
+ res = EAGAIN; // Thank you for playing; try again
/* Failed to acquire the lock; another has possession of it */
- } else {
- errnoValue = res;
}
- FileLockAppendMessage(msgs, errnoValue);
+ FileLockAppendMessage(msgs, res);
+ }
+
+ if (err != NULL) {
+ *err = res;
}
return tokenPtr;