From 9c91b2051a61758c8ebfb5be7f2a81dc32c5de33 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 7 Oct 2019 09:45:21 +0200 Subject: Disable socket descriptor sharing with subprocs. On Unix systems, sockets are like file descriptors, and file descriptors are usually shared among child processes. This means, that if we spawn a subprocess (or we fork) like we do in the editor, open file descriptors will leak to the new process. This causes issue with sockets as they might remain open and bound (listening) when the original process closes. --- drivers/unix/net_socket_posix.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/unix/net_socket_posix.h') diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index 40406b241a..e549ea1d6a 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -61,6 +61,7 @@ private: NetError _get_socket_error(); void _set_socket(SOCKET_TYPE p_sock, IP::Type p_ip_type, bool p_is_stream); _FORCE_INLINE_ Error _change_multicast_group(IP_Address p_ip, String p_if_name, bool p_add); + _FORCE_INLINE_ void _set_close_exec_enabled(bool p_enabled); protected: static NetSocket *_create_func(); -- cgit v1.2.3