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