mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
popen: Replace fcntl with ioctl
The fcntl interface sets the O_CLOEXEC property by calling the ioctl interface. Let's call the ioctl interface directly. Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
This commit is contained in:
parent
ff85c8c0d9
commit
7503f7bf33
1 changed files with 2 additions and 1 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/wait.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -322,7 +323,7 @@ FILE *popen(FAR const char *command, FAR const char *mode)
|
|||
|
||||
if (strchr(mode, 'e') == NULL)
|
||||
{
|
||||
fcntl(retfd, F_SETFD, 0);
|
||||
ioctl(retfd, FIOCLEX, 0);
|
||||
}
|
||||
|
||||
/* Finale and return input input/output stream */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue