Skip to content

Commit

Permalink
bugfix and some changes to xml saving
Browse files Browse the repository at this point in the history
  • Loading branch information
alxnik committed Dec 31, 2012
1 parent bf62fd8 commit 2458822
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CXMLDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CXMLDb::Insert(DataContainerList &DataList)

if(!LoadBackupFile())
{
Log.error("Unable to Load XML file\n");
pthread_mutex_unlock(&FileMutex);
return false;
}
Expand All @@ -51,7 +52,6 @@ CXMLDb::Insert(DataContainerList &DataList)
{
DataContainer Data = DataList.front();

syslog(LOG_INFO, "Pushing element\n");
XMLNode *ProbeData = m_BackupFile->NewElement("pd");

for( DataContainer::iterator ii=Data.begin(); ii!=Data.end(); ++ii)
Expand All @@ -67,13 +67,15 @@ CXMLDb::Insert(DataContainerList &DataList)

if(!SaveBackupFile())
{
Log.error("Unable to save XML file\n");
pthread_mutex_unlock(&FileMutex);
return false;
}

pthread_mutex_unlock(&FileMutex);
return true;
}

int
CXMLDb:: Restore(DataContainer &Data)
{
Expand Down Expand Up @@ -169,7 +171,7 @@ CXMLDb::SaveBackupFile(void)
if(!m_BackupFile)
return false;

if(!m_BackupFile->SaveFile(m_FileName.c_str()))
if(m_BackupFile->SaveFile(m_FileName.c_str()))
return false;

return true;
Expand Down

0 comments on commit 2458822

Please sign in to comment.