mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
uorb: enable O_CLOEXEC explicit
to avoid potential fd leak which 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
bae15dfd58
commit
767c8ea6ce
1 changed files with 1 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ static int orb_advsub_open(FAR const struct orb_metadata *meta, int flags,
|
|||
reginfo.nbuffer = queue_size;
|
||||
reginfo.persist = !!(flags & SENSOR_PERSIST);
|
||||
|
||||
fd = open(ORB_USENSOR_PATH, O_WRONLY);
|
||||
fd = open(ORB_USENSOR_PATH, O_WRONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
{
|
||||
return fd;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue