]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawRootdDB.cxx
Updates to RAW package. Used during the Computing DC.
[u/mrichter/AliRoot.git] / RAW / AliRawRootdDB.cxx
index 1de0c9a30bd5db16cc57526b4b3de7c877949a66..542e3de5d00e43345717e679884efadd5d411d87 100644 (file)
@@ -87,21 +87,29 @@ const char *AliRawRootdDB::GetFileName() const
 }
 
 //______________________________________________________________________________
-void AliRawRootdDB::Close()
+Int_t AliRawRootdDB::Close()
 {
    // Close raw rootd DB.
 
-   if (!fRawDB) return;
+   if (!fRawDB) return 0;
+
+   if (!fRawDB->IsOpen()) return 0;
 
    fRawDB->cd();
 
    // Write the tree.
-   fTree->Write();
-   if (fESDTree) fESDTree->Write();
+   Bool_t error = kFALSE;
+   if (fTree->Write() == 0)
+     error = kTRUE;
+   if (fESDTree)
+     if (fESDTree->Write() == 0)
+       error = kTRUE;
 
    // Close DB, this also deletes the fTree
    fRawDB->Close();
 
+   Int_t filesize = fRawDB->GetEND();
+
 #if 0
    // can use services of TFTP
    if (fDeleteFiles)
@@ -110,4 +118,8 @@ void AliRawRootdDB::Close()
 
    delete fRawDB;
    fRawDB = 0;
+   if(!error)
+     return filesize;
+   else
+     return -1;
 }