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
@ -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…
x
Reference in New Issue
Block a user