From cd2dbb2e146562c9e37c614bb09a24f7fbf135e0 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 3 Dec 2020 22:26:46 +0100 Subject: Quite important network stuff --- libnet/inc/net.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libnet/inc/net.h') diff --git a/libnet/inc/net.h b/libnet/inc/net.h index a897f1d..1b6a17d 100644 --- a/libnet/inc/net.h +++ b/libnet/inc/net.h @@ -4,7 +4,6 @@ #define NET_H #include -#include #include #include #include @@ -48,8 +47,8 @@ static inline int net_connect(struct socket *socket, u32 ip_addr, u16 dst_port, static inline int net_close(struct socket *socket) { int res = 0; - while (!(res = (int)sys1(SYS_NET_CLOSE, (int)(socket)))) - ; + while (socket->state == S_CLOSING || !(res = (int)sys1(SYS_NET_CLOSE, (int)(socket)))) + yield(); return res; } -- cgit v1.2.3