From: Alan Cox Date: Sat, 3 Jun 2017 22:48:31 +0000 (+0100) Subject: net_native: close() should not block X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3a4dacd7e1d7706814e52f9571ec7534f1533627;p=FUZIX.git 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() --- 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 */ } /*