aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-11-29 15:37:11 +0100
committerSiri Hansen <[email protected]>2011-11-29 17:04:41 +0100
commit038b9dd3a1f9bdd86cbb83bf3484ab1529d4fca2 (patch)
tree9b3e5eaf6152dd673e966a9e4c30cc6506361879 /lib/stdlib/doc
parent2b36dd726551cf822041b065df5d753ed0dba8b1 (diff)
downloadotp-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/stdlib/doc')
-rw-r--r--lib/stdlib/doc/src/gen_server.xml10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml
index 1045766e01..edeb7dff91 100644
--- a/lib/stdlib/doc/src/gen_server.xml
+++ b/lib/stdlib/doc/src/gen_server.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2010</year>
+ <year>1996</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -570,13 +570,14 @@ gen_server:abcast -----> Module:handle_cast/2
</desc>
</func>
<func>
- <name>Module:code_change(OldVsn, State, Extra) -> {ok, NewState}</name>
+ <name>Module:code_change(OldVsn, State, Extra) -> {ok, NewState} | {error, Reason}</name>
<fsummary>Update the internal state during upgrade/downgrade.</fsummary>
<type>
<v>OldVsn = Vsn | {down, Vsn}</v>
<v>&nbsp;&nbsp;Vsn = term()</v>
<v>State = NewState = term()</v>
<v>Extra = term()</v>
+ <v>Reason = term()</v>
</type>
<desc>
<p>This function is called by a gen_server when it should
@@ -595,7 +596,10 @@ gen_server:abcast -----> Module:handle_cast/2
<p><c>State</c> is the internal state of the gen_server.</p>
<p><c>Extra</c> is passed as-is from the <c>{advanced,Extra}</c>
part of the update instruction.</p>
- <p>The function should return the updated internal state.</p>
+ <p>If successful, the function shall return the updated
+ internal state.</p>
+ <p>If the function returns <c>{error,Reason}</c>, the ongoing
+ upgrade will fail and roll back to the old release.</p>
</desc>
</func>
<func>