diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-11-02 13:17:27 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-11-02 13:17:27 +0000 |
| commit | 549aba2e04926e92906bd249870d423d99b6414f (patch) | |
| tree | ff887fe79c632d1e31d55f6d51551494791820c1 /src | |
| parent | 67bb7dca1b555186046f9327009faa048fade25c (diff) | |
| download | rabbitmq-server-git-549aba2e04926e92906bd249870d423d99b6414f.tar.gz | |
Refactor: reduce distance from default.
Diffstat (limited to 'src')
| -rw-r--r-- | src/supervisor2.erl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl index 931a408f93..c40539de00 100644 --- a/src/supervisor2.erl +++ b/src/supervisor2.erl @@ -703,19 +703,16 @@ child_res(#child{restart_type = permanent}, normal, false) -> ok; child_res(#child{restart_type = {permanent, _}}, normal, false) -> ok; child_res(#child{}, R, _) -> {error, R}. -restart_permanent(permanent) -> true; -restart_permanent({permanent, _Delay}) -> true; -restart_permanent(_) -> false. - do_terminate(Child, SupName) when Child#child.pid =/= undefined -> ReportError = shutdown_error_reporter(SupName), case shutdown(Child#child.pid, Child#child.shutdown) of ok -> ok; {error, normal} -> - case restart_permanent(Child#child.restart_type) of - true -> ReportError(normal, Child); - false -> ok + case Child#child.restart_type of + permanent -> ReportError(normal); + {permanent, _Delay} -> ReportError(normal); + _ -> ok end; {error, OtherReason} -> ReportError(OtherReason, Child) |
