mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 07:12:06 +08:00
nshlib: enable O_CLOEXEC explicit to avoid potential fd leak
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:
@@ -598,7 +598,7 @@ static int cmd_rpmsg_once(FAR struct nsh_vtbl_s *vtbl,
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
fd = open(path, 0);
|
||||
fd = open(path, O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
{
|
||||
nsh_output(vtbl, g_fmtarginvalid, path);
|
||||
|
Reference in New Issue
Block a user