diff --git a/system/popen/popen.c b/system/popen/popen.c index 254f86ae6..a873f3864 100644 --- a/system/popen/popen.c +++ b/system/popen/popen.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -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 */