aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Cribbs <[email protected]>2013-02-06 16:28:25 -0600
committerSean Cribbs <[email protected]>2013-02-11 10:12:47 -0600
commit288d2431d99bc9dc30c6c6e9564546399c29db60 (patch)
treec5afabbcb891ea8c1d1bf267ed66bf3e59eeac77
parent2ec63b31743a177446884ed12736607d3fbea1ef (diff)
downloadotp-288d2431d99bc9dc30c6c6e9564546399c29db60.tar.gz
otp-288d2431d99bc9dc30c6c6e9564546399c29db60.tar.bz2
otp-288d2431d99bc9dc30c6c6e9564546399c29db60.zip
Fix type of error Reason on gen_tcp:send/2
When the TCP socket is in passive mode, it is possible that a close message has not been delivered to the controlling process before calling send/2. This results in the returning {error, closed} to the caller, in the same way that recv/2,3 does. This commit adjusts the type of the error "Reason" to include the atom 'closed'.
-rw-r--r--lib/kernel/src/gen_tcp.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl
index ec13ab6d2e..23867300a5 100644
--- a/lib/kernel/src/gen_tcp.erl
+++ b/lib/kernel/src/gen_tcp.erl
@@ -256,7 +256,7 @@ close(S) ->
-spec send(Socket, Packet) -> ok | {error, Reason} when
Socket :: socket(),
Packet :: iodata(),
- Reason :: inet:posix().
+ Reason :: closed | inet:posix().
send(S, Packet) when is_port(S) ->
case inet_db:lookup_socket(S) of