Skip to content

Commit

Permalink
Silence UnlockFile errors on Win32 to pass more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed May 31, 2024
1 parent 44f5893 commit ea4e36a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libcob/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3130,7 +3130,7 @@ unlock_record(cob_file *f, unsigned int recnum)
osHandle = (HANDLE)_get_osfhandle (f->fd);
if (osHandle != INVALID_HANDLE_VALUE) {
if (!UnlockFile (osHandle, 0, 0, MAXDWORD, MAXDWORD)) {
#if 1 /* CHECKME - What is the correct thing to do here? */
#if 0 /* CHECKME - What is the correct thing to do here? */
/* not translated as "testing only" */
cob_runtime_warning ("issue during UnLockFile (%s), lastError: " CB_FMT_LLU,
"unlock_record", (cob_u64_t)GetLastError ());
Expand Down Expand Up @@ -4653,7 +4653,7 @@ cob_file_close (cob_file_api *a, cob_file *f, const int opt)
HANDLE osHandle = (HANDLE)_get_osfhandle (f->fd);
if (osHandle != INVALID_HANDLE_VALUE) {
if (!UnlockFile (osHandle, 0, 0, MAXDWORD, MAXDWORD)) {
#if 1 /* CHECKME - What is the correct thing to do here? */
#if 0 /* CHECKME - What is the correct thing to do here? */
/* not translated as "testing only" */
cob_runtime_warning ("issue during UnLockFile (%s), lastError: " CB_FMT_LLU,
"cob_file_close", (cob_u64_t)GetLastError ());
Expand Down Expand Up @@ -6269,7 +6269,7 @@ cob_file_unlock (cob_file *f)
HANDLE osHandle = (HANDLE)_get_osfhandle (f->fd);
if (osHandle != INVALID_HANDLE_VALUE) {
if (!UnlockFile (osHandle, 0, 0, MAXDWORD, MAXDWORD)) {
#if 1 /* CHECKME - What is the correct thing to do here? */
#if 0 /* CHECKME - What is the correct thing to do here? */
/* not translated as "testing only" */
cob_runtime_warning ("issue during UnLockFile (%s), lastError: " CB_FMT_LLU,
"cob_file_unlock", (cob_u64_t)GetLastError());
Expand Down

0 comments on commit ea4e36a

Please sign in to comment.