From a6370639ee49d57980ee23b022bbcb7adc725e74 Mon Sep 17 00:00:00 2001
From: Thomas Owen James <tjames@cmd-scouting-ctrlhub.dyndns.cern.ch>
Date: Mon, 5 Sep 2022 18:28:34 +0200
Subject: [PATCH] changed behaviour when counts==0

---
 src/outputByOrbit.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/outputByOrbit.cc b/src/outputByOrbit.cc
index 9f273636..afac85b1 100644
--- a/src/outputByOrbit.cc
+++ b/src/outputByOrbit.cc
@@ -82,10 +82,10 @@ void* OutputByOrbitStream::OutputFixedOrbits( Slice& out ) {
 	n = fwrite( out.begin(), 1, out.size(), outFile.getFile() );
 
       } 
+      current_file_size +=n;    
+    }else{ // i.e should not currently be writing data
+      close_and_move_file();//once for each open file (should be 2)
     }
-    current_file_size +=n;    
-  }else{ // i.e should not currently be writing data
-    close_and_move_file();//once for each open file (should be 2)
   }
 }
 
-- 
GitLab