summaryrefslogtreecommitdiff
path: root/src/grt/grt-processes.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-05-21 07:00:35 +0200
committerTristan Gingold2015-05-21 07:00:35 +0200
commit3826656eaff634b0349b610f274203b3026d3f87 (patch)
tree402c0f3537664318e0007f347d3dd59d9eb806d8 /src/grt/grt-processes.adb
parentbd1885c3d60019a28bb8261d8a17cef5533d27f9 (diff)
downloadghdl-3826656eaff634b0349b610f274203b3026d3f87.tar.gz
ghdl-3826656eaff634b0349b610f274203b3026d3f87.tar.bz2
ghdl-3826656eaff634b0349b610f274203b3026d3f87.zip
Rework exit handling to correctly report exit status.
Fix ticket 77.
Diffstat (limited to 'src/grt/grt-processes.adb')
-rw-r--r--src/grt/grt-processes.adb11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/grt/grt-processes.adb b/src/grt/grt-processes.adb
index 4a124e6..01e8394 100644
--- a/src/grt/grt-processes.adb
+++ b/src/grt/grt-processes.adb
@@ -707,6 +707,9 @@ package body Grt.Processes is
Run_Finished : constant Integer := 3;
-- Failure, simulation should stop.
Run_Failure : constant Integer := -1;
+ -- Stop/finish request from user (via std.env).
+ Run_Stop : constant Integer := -2;
+ pragma Unreferenced (Run_Stop);
Mt_Last : Natural;
Mt_Table : Process_Acc_Array_Acc;
@@ -1015,7 +1018,7 @@ package body Grt.Processes is
Status := Run_Through_Longjump (Initialization_Phase'Access);
if Status /= Run_Resumed then
- return -1;
+ return Status;
end if;
Nbr_Delta_Cycles := 0;
@@ -1074,11 +1077,7 @@ package body Grt.Processes is
Grt.Hooks.Call_Finish_Hooks;
- if Status = Run_Failure then
- return -1;
- else
- return Exit_Status ;
- end if;
+ return Status;
end Simulation;
end Grt.Processes;