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 | b2c2f954600740bd8d4f2e17414f5d71725e3c33 (patch) | |
tree | ff887fe79c632d1e31d55f6d51551494791820c1 | |
parent | ce14a6f69aaf16c0ed4d17f2d6f6eb3d8873daa7 (diff) | |
download | rabbitmq-server-b2c2f954600740bd8d4f2e17414f5d71725e3c33.tar.gz |
Refactor: reduce distance from default.
-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 931a408f..c40539de 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) |