add FILE_LONG_LIVED flag when opening XML file in the process of building XMB (avoids warning)
This was SVN commit r3471.
This commit is contained in:
parent
67f8087b6f
commit
7bf48e95c4
@ -86,7 +86,7 @@ public:
|
||||
|
||||
// Open a VFS path for XML parsing
|
||||
// returns 0 if successful, -1 on failure
|
||||
int OpenFile(const char *path);
|
||||
int OpenFile(const char *path, uint flags);
|
||||
|
||||
// Allow the use of externally-loaded files
|
||||
void OpenBuffer(const char* path, const void* buffer, const size_t buffersize);
|
||||
|
@ -49,9 +49,9 @@ XMLCh *XMLTranscode(const char *str)
|
||||
return XMLString::transcode(str);
|
||||
}
|
||||
|
||||
int CVFSInputSource::OpenFile(const char *path)
|
||||
int CVFSInputSource::OpenFile(const char *path, uint flags = 0)
|
||||
{
|
||||
LibError ret = vfs_load(path, m_pBuffer, m_BufferSize);
|
||||
LibError ret = vfs_load(path, m_pBuffer, m_BufferSize, flags);
|
||||
if(ret != ERR_OK)
|
||||
{
|
||||
LOG(ERROR, LOG_CATEGORY, "CVFSInputSource: file %s couldn't be loaded (vfs_load: %d)", path, ret);
|
||||
@ -80,6 +80,7 @@ CVFSInputSource::~CVFSInputSource()
|
||||
{
|
||||
// our buffer was vfs_load-ed; free it now
|
||||
(void)file_buf_free(m_pBuffer);
|
||||
m_pBuffer = 0;
|
||||
}
|
||||
|
||||
BinInputStream *CVFSInputSource::makeStream() const
|
||||
|
@ -247,8 +247,10 @@ PSRETURN CXeromyces::Load(const char* filename)
|
||||
}
|
||||
|
||||
// Open the .xml file
|
||||
// note: FILE_LONG_LIVED is necessary because we load XML, load DTD,
|
||||
// and only then free XML.
|
||||
CVFSInputSource source;
|
||||
if (source.OpenFile(filename) < 0)
|
||||
if (source.OpenFile(filename, FILE_LONG_LIVED) < 0)
|
||||
{
|
||||
LOG(ERROR, LOG_CATEGORY, "CXeromyces: Failed to open XML file %s", filename);
|
||||
return PSRETURN_Xeromyces_XMLOpenFailed;
|
||||
|
Loading…
Reference in New Issue
Block a user