]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliMDC.cxx
Adding a track candle for p-A correlations and comparison with CMS.
[u/mrichter/AliRoot.git] / RAW / AliMDC.cxx
index 5bf1e0a18d1085de59a0d22cb99886090b3bda96..869948a78e2b3b99950f64151dbf338de0d3c789 100644 (file)
@@ -510,7 +510,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
   if (fRawDB) Close();
 
   if (Open(mode,NULL,maxFileSize,fs1,fs2) < 0) {
-    close(fd);
+    if (fd>-1) close(fd);
     return 1;
   }
   // Process input stream
@@ -548,7 +548,6 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
       Error("Run", "AliMDC was compiled without event builder support");
       delete fRawDB;
       fRawDB = NULL;
-      close(fd);
       return 1;
 #endif
 
@@ -568,7 +567,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
            Error("Run", "error reading base header");
            Close();
            delete[] event;
-           close(fd);
+           if (fd>-1) close(fd);
            return 1;
          }
        }
@@ -597,7 +596,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
          Close();
          delete[] event;
          delete hdr;
-         close(fd);
+         if (fd>-1) close(fd);
          return 1;
        }
       }
@@ -617,7 +616,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
        Close();
        delete[] event;
        delete hdr;
-       close(fd);
+       if (fd>-1) close(fd);
        return 1;
       }
     }
@@ -648,7 +647,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
          Close();
          if (inputFile) delete[] event;
          delete hdr;
-         close(fd);
+         if (fd>-1) close(fd);
          return 1;
        }
 
@@ -701,7 +700,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
 #endif
   } else {
     // Close input source
-    close(fd);
+    if (fd>-1) close(fd);
     delete [] event;
   }