From 01a43254496da0c4858476ea038b70fbd6c2f3db Mon Sep 17 00:00:00 2001
From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr>
Date: Wed, 20 Mar 2019 15:15:59 +0100
Subject: [PATCH] Fix: always exit before launching any simulation when -gld is
 used

---
 lib/sasacore/sasa.ml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/sasacore/sasa.ml b/lib/sasacore/sasa.ml
index 16649572..b598862c 100644
--- a/lib/sasacore/sasa.ml
+++ b/lib/sasacore/sasa.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 18/03/2019 (at 09:21) by Erwan Jahier> *)
+(* Time-stamp: <modified the 20/03/2019 (at 12:09) by Erwan Jahier> *)
 
 (* XXX Je pourrais utiliser Lwt pour rendre step non-bloquant, ce qui
    permettrait d'accelerer la simu sur les machines qui ont plusieurs
@@ -170,7 +170,8 @@ let (make : string array -> t) =
     if args.gen_lutin then (
       let fn = (Filename.remove_extension args.topo) ^ ".lut" in
       if Sys.file_exists fn then (
-        Printf.eprintf "%s already exists.\n" fn; flush stderr
+        Printf.eprintf "%s already exists: rename it to proceed.\n" fn;
+        flush stderr; exit 1
       ) else 
         let oc = open_out fn in
         Printf.fprintf oc "%s" (GenLutin.f pl);
-- 
GitLab