diff options
author | Siri Hansen <[email protected]> | 2011-11-29 15:37:11 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2011-11-29 17:04:41 +0100 |
commit | 038b9dd3a1f9bdd86cbb83bf3484ab1529d4fca2 (patch) | |
tree | 9b3e5eaf6152dd673e966a9e4c30cc6506361879 /lib/sasl/src | |
parent | 2b36dd726551cf822041b065df5d753ed0dba8b1 (diff) | |
download | otp-038b9dd3a1f9bdd86cbb83bf3484ab1529d4fca2.tar.gz otp-038b9dd3a1f9bdd86cbb83bf3484ab1529d4fca2.tar.bz2 otp-038b9dd3a1f9bdd86cbb83bf3484ab1529d4fca2.zip |
Fix dialyzer warnings in supervisor
Dialyzer complained over a mismatch between the callback spec of
Mod:code_change in gen_server and the spec of supervisor:code_change
(which is the implementation of a gen_server Mod:code_change).
This commit changes the callback spec to allow {error,Reason} as
return value. Also, release_handler is updated to handle this return
value.
Diffstat (limited to 'lib/sasl/src')
-rw-r--r-- | lib/sasl/src/release_handler_1.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl index 37275eff45..93d12cf609 100644 --- a/lib/sasl/src/release_handler_1.erl +++ b/lib/sasl/src/release_handler_1.erl @@ -505,15 +505,20 @@ resume(Pids) -> change_code(Pids, Mod, Vsn, Extra, Timeout) -> Fun = fun(Pid) -> - case Timeout of - default -> - ok = sys:change_code(Pid, Mod, Vsn, Extra); - _Else -> - ok = sys:change_code(Pid, Mod, Vsn, Extra, Timeout) + case sys_change_code(Pid, Mod, Vsn, Extra, Timeout) of + ok -> + ok; + {error,Reason} -> + throw({code_change_failed,Pid,Mod,Vsn,Reason}) end end, lists:foreach(Fun, Pids). +sys_change_code(Pid, Mod, Vsn, Extra, default) -> + sys:change_code(Pid, Mod, Vsn, Extra); +sys_change_code(Pid, Mod, Vsn, Extra, Timeout) -> + sys:change_code(Pid, Mod, Vsn, Extra, Timeout). + stop(Mod, Procs) -> lists:zf(fun({undefined, _Name, _Pid, _Mods}) -> false; |