diff options
author | Lukas Larsson <[email protected]> | 2011-12-07 14:46:26 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-12-07 19:19:17 +0100 |
commit | 1137c0a08b25ab5e38286260f0b7c51ba015afbb (patch) | |
tree | 4258119045dc70037e41fd55e16cdd55724c53a9 /lib/kernel/src/file.erl | |
parent | f34a89e0c0cc92226d5fe3fb257c62251068392b (diff) | |
download | otp-1137c0a08b25ab5e38286260f0b7c51ba015afbb.tar.gz otp-1137c0a08b25ab5e38286260f0b7c51ba015afbb.tar.bz2 otp-1137c0a08b25ab5e38286260f0b7c51ba015afbb.zip |
Return {error,closed} from sendfile if closed
If the socket is closed by the remote end, sendfile
now returns {error,closed}.
Diffstat (limited to 'lib/kernel/src/file.erl')
-rw-r--r-- | lib/kernel/src/file.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index 0b0f91d86a..a3c0e7da26 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -1124,7 +1124,8 @@ change_time(Name, Atime, Mtime) -define(MAX_CHUNK_SIZE, (1 bsl 20)*20). %% 20 MB, has to fit in primary memory -spec sendfile(RawFile, Socket, Offset, Bytes, Opts) -> - {'ok', non_neg_integer()} | {'error', inet:posix() | badarg | not_owner} when + {'ok', non_neg_integer()} | {'error', inet:posix() | + closed | badarg | not_owner} when RawFile :: file:fd(), Socket :: inet:socket(), Offset :: non_neg_integer(), @@ -1149,7 +1150,8 @@ sendfile(File, Sock, Offset, Bytes, Opts) -> %% sendfile/2 -spec sendfile(Filename, Socket) -> - {'ok', non_neg_integer()} | {'error', inet:posix() | badarg | not_owner} + {'ok', non_neg_integer()} | {'error', inet:posix() | + closed | badarg | not_owner} when Filename :: file:name(), Socket :: inet:socket(). sendfile(Filename, Sock) -> |