Set CLOEXEC flag on sockets
If SOCK_CLOEXEC exists, then set the flag on socket creation. Otherwise, use fcntl() (or SetHandleInformation() on Windows) to set the flag afterwards. This avoids the sockets to be inherited in child processes. Refs #2783 <https://github.com/Genymobile/scrcpy/pull/2783>
This commit is contained in:
@@ -149,6 +149,9 @@ foreach f : check_functions
|
||||
endif
|
||||
endforeach
|
||||
|
||||
conf.set('HAVE_SOCK_CLOEXEC', host_machine.system() != 'windows' and
|
||||
cc.has_header_symbol('sys/socket.h', 'SOCK_CLOEXEC'))
|
||||
|
||||
# the version, updated on release
|
||||
conf.set_quoted('SCRCPY_VERSION', meson.project_version())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user