From a8b656a0908d3af0d6776b662be5280867593be4 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 27 Apr 2011 14:36:22 +0200 Subject: Handle exit reason {shutdown,Term} as shutdown for children of supervisor In R13B proc_lib, gen_server and gen_fsm were all changed to handle exit reason {shutdown,Term} in the same way as exit reason 'shutdown', i.e. no crash reports are generated. This is an update of supervisor to do the same, i.e. handle these two exit reasons in the same way. This means that for children with restart type 'transient' there will be no attempt to restart the process if it terminates with reason {shutdown,Term}, and there will be no supervisor report. --- lib/stdlib/test/supervisor_1.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/stdlib/test/supervisor_1.erl') diff --git a/lib/stdlib/test/supervisor_1.erl b/lib/stdlib/test/supervisor_1.erl index 3198be0fed..f819594c46 100644 --- a/lib/stdlib/test/supervisor_1.erl +++ b/lib/stdlib/test/supervisor_1.erl @@ -62,6 +62,12 @@ handle_info(die, State) -> handle_info(stop, State) -> {stop, normal, State}; +handle_info({'EXIT',_,shutdown}, State) -> + {stop, shutdown, State}; + +handle_info({'EXIT',_,{shutdown,Term}}, State) -> + {stop, {shutdown,Term}, State}; + handle_info({sleep, Time}, State) -> io:format("FOO: ~p~n", [Time]), timer:sleep(Time), -- cgit v1.2.3