Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
06c82a36
Commit
06c82a36
authored
5 years ago
by
Valentin Perrelle
Browse files
Options
Downloads
Patches
Plain Diff
[Server] catch Sys.Break at server main loop
parent
5c67fbc5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/server/main.ml
+12
-6
12 additions, 6 deletions
src/plugins/server/main.ml
with
12 additions
and
6 deletions
src/plugins/server/main.ml
+
12
−
6
View file @
06c82a36
...
...
@@ -287,18 +287,24 @@ let run ~pretty ?(equal=(=)) ~fetch () =
shutdown
=
false
;
}
in
try
(* TODO: remove the following line once the Why3 signal handler is not
used anymore. *)
Sys
.
catch_break
true
;
signal
true
;
Senv
.
feedback
"Server running."
;
while
not
server
.
shutdown
do
let
activity
=
process
server
in
if
not
activity
then
Unix
.
sleepf
idle_s
;
done
;
begin
try
while
not
server
.
shutdown
do
let
activity
=
process
server
in
if
not
activity
then
Unix
.
sleepf
idle_s
;
done
;
with
Sys
.
Break
->
()
(* Ctr+C, just leave the loop normally *)
end
;
Senv
.
feedback
"Server shutdown."
;
signal
false
;
with
e
rr
->
with
e
xn
->
Senv
.
feedback
"Server interruped (fatal error)."
;
signal
false
;
raise
e
rr
raise
e
xn
end
(* -------------------------------------------------------------------------- *)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment