aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/gen_tcp.erl7
-rw-r--r--lib/kernel/src/inet_int.hrl2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl
index 26afed4ff9..3f1e432f7a 100644
--- a/lib/kernel/src/gen_tcp.erl
+++ b/lib/kernel/src/gen_tcp.erl
@@ -420,15 +420,16 @@ mod([], Address) ->
sendfile(#file_descriptor{ module = Mod } = Fd, Sock, Offset, Bytes,
ChunkSize, Headers, Trailers, Nodiskio, MNowait, Sync)
when is_port(Sock) ->
- {ok,SockFd} = prim_inet:stealfd(Sock),
+ ok = prim_inet:ignorefd(Sock,true),
+ {ok, SockFd} = prim_inet:getfd(Sock),
case Mod:sendfile(Fd, SockFd, Offset, Bytes, ChunkSize, Headers, Trailers,
Nodiskio, MNowait, Sync) of
{error, enotsup} ->
- prim_inet:returnfd(Sock),
+ ok = prim_inet:ignorefd(Sock,false),
sendfile_fallback(Fd, Sock, Offset, Bytes, ChunkSize,
Headers, Trailers);
Else ->
- prim_inet:returnfd(Sock),
+ ok = prim_inet:ignorefd(Sock,false),
Else
end;
sendfile(_,_,_,_,_,_,_,_,_,_) ->
diff --git a/lib/kernel/src/inet_int.hrl b/lib/kernel/src/inet_int.hrl
index f8984b13fe..cf893c73eb 100644
--- a/lib/kernel/src/inet_int.hrl
+++ b/lib/kernel/src/inet_int.hrl
@@ -85,6 +85,8 @@
-define(INET_REQ_GETIFADDRS, 25).
-define(INET_REQ_ACCEPT, 26).
-define(INET_REQ_LISTEN, 27).
+-define(INET_REQ_IGNOREFD, 28).
+
%% TCP requests
%%-define(TCP_REQ_ACCEPT, 40). MOVED
%%-define(TCP_REQ_LISTEN, 41). MERGED