mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-13 14:10:23 +00:00
enable SOCK_CLOEXEC explicit
leaking here means fork/vfork will duplicate fd without O_CLOEXEC flag to the child process. Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
parent
3f0c9306d3
commit
eab2cba4a1
20 changed files with 56 additions and 30 deletions
|
|
@ -182,7 +182,7 @@ static inline bool net_connection(struct net_listener_s *nls)
|
|||
printf("lo_listener: Accepting new connection on sd=%d\n",
|
||||
nls->listensd);
|
||||
|
||||
sd = accept(nls->listensd, NULL, NULL);
|
||||
sd = accept4(nls->listensd, NULL, NULL, SOCK_CLOEXEC);
|
||||
if (sd < 0)
|
||||
{
|
||||
printf("lo_listener: accept failed: %d\n", errno);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue