repository writer: fix use of incorrect header size
The header size of the package file header was used, which resulted in broken repository files.
This commit is contained in:
parent
32086850f7
commit
695a1b248a
@ -100,7 +100,7 @@ protected:
|
||||
typedef DoublyLinkedList<PackageAttribute> PackageAttributeList;
|
||||
|
||||
protected:
|
||||
status_t Init(const char* fileName,
|
||||
status_t Init(const char* fileName, size_t headerSize,
|
||||
const BPackageWriterParameters& parameters);
|
||||
|
||||
void RegisterPackageInfo(
|
||||
|
@ -606,7 +606,8 @@ status_t
|
||||
PackageWriterImpl::_Init(const char* fileName,
|
||||
const BPackageWriterParameters& parameters)
|
||||
{
|
||||
status_t result = inherited::Init(fileName, parameters);
|
||||
status_t result = inherited::Init(fileName, sizeof(hpkg_header),
|
||||
parameters);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
|
@ -250,7 +250,8 @@ RepositoryWriterImpl::Finish()
|
||||
status_t
|
||||
RepositoryWriterImpl::_Init(const char* fileName)
|
||||
{
|
||||
return inherited::Init(fileName, BPackageWriterParameters());
|
||||
return inherited::Init(fileName, sizeof(hpkg_repo_header),
|
||||
BPackageWriterParameters());
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,7 +243,7 @@ WriterImplBase::~WriterImplBase()
|
||||
|
||||
|
||||
status_t
|
||||
WriterImplBase::Init(const char* fileName,
|
||||
WriterImplBase::Init(const char* fileName, size_t headerSize,
|
||||
const BPackageWriterParameters& parameters)
|
||||
{
|
||||
fParameters = parameters;
|
||||
@ -266,8 +266,8 @@ WriterImplBase::Init(const char* fileName,
|
||||
fFileName = fileName;
|
||||
|
||||
// create heap writer
|
||||
fHeapWriter = new PackageFileHeapWriter(fErrorOutput, FD(),
|
||||
sizeof(hpkg_header), fParameters.CompressionLevel());
|
||||
fHeapWriter = new PackageFileHeapWriter(fErrorOutput, FD(), headerSize,
|
||||
fParameters.CompressionLevel());
|
||||
fHeapWriter->Init();
|
||||
fDataWriter = fHeapWriter->DataWriter();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user