Skip to content

Commit

Permalink
Backport locking patch from chw
Browse files Browse the repository at this point in the history
  • Loading branch information
apnadkarni committed Oct 3, 2023
1 parent 56f57b3 commit 13bccc6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions generic/tclZipfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,6 @@ ZipFSCatalogFilesystem(
ckfree(zf);
return TCL_ERROR;
}
Unlock();

/*
* Convert to a real archive descriptor.
Expand Down Expand Up @@ -2113,8 +2112,8 @@ ZipFSCatalogFilesystem(
}
Tcl_DStringFree(&fpBuf);
Tcl_DStringFree(&ds);
Tcl_FSMountsChanged(NULL);
Unlock();
Tcl_FSMountsChanged(NULL);
return TCL_OK;
}

Expand Down Expand Up @@ -4350,6 +4349,7 @@ ZipChannelClose(
info->isEncrypted = 0;
memset(info->keys, 0, sizeof(info->keys));
}
WriteLock();
if (info->isWriting) {
/*
* Copy channel data back into original file in archive.
Expand Down Expand Up @@ -4384,7 +4384,6 @@ ZipChannelClose(
z->offset = 0;
z->crc32 = 0;
}
WriteLock();
info->zipFilePtr->numOpen--;
Unlock();
if (info->ubufToFree) {
Expand Down

0 comments on commit 13bccc6

Please sign in to comment.