From 3a4dacd7e1d7706814e52f9571ec7534f1533627 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 3 Jun 2017 23:48:31 +0100 Subject: [PATCH] net_native: close() should not block The close process is supposed to go on asynchronously behind the back of the closing process. This is important because we are going to stop processes from sleeping during an execve() --- Kernel/dev/net/net_native.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Kernel/dev/net/net_native.c b/Kernel/dev/net/net_native.c index 6749a3cc..9ed11545 100644 --- a/Kernel/dev/net/net_native.c +++ b/Kernel/dev/net/net_native.c @@ -491,7 +491,10 @@ int net_connect(struct socket *s) void net_close(struct socket *s) { /* Caution here - the native tcp socket will hang around longer */ - netn_synchronous_event(s, SS_CLOSED); + sd->newstate = SS_CLOSED; + netn_asynchronous_event(s, NEV_STATE|NEVW_STATE); + /* Don't block. We won't reuse the entry until it moves to + CLOSED state */ } /* -- 2.34.1