[Tarantool-patches] [PATCH 3/7] popen: close_inherited_fds - add support for macos/freebsd
Cyrill Gorcunov
gorcunov at gmail.com
Mon Mar 2 23:12:23 MSK 2020
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
src/lib/core/popen.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
index 0e2d9dd00..ce7d7fff7 100644
--- a/src/lib/core/popen.c
+++ b/src/lib/core/popen.c
@@ -529,8 +529,11 @@ make_pipe(int pfd[2])
static int
close_inherited_fds(int *skip_fds, size_t nr_skip_fds)
{
-#ifdef TARGET_OS_LINUX
+# if defined(TARGET_OS_LINUX)
static const char path[] = "/proc/self/fd";
+# else
+ static const char path[] = "/dev/fd";
+# endif
struct dirent *de;
int fd_no, fd_dir;
DIR *dir;
@@ -577,17 +580,6 @@ close_inherited_fds(int *skip_fds, size_t nr_skip_fds)
diag_set(SystemError, "fdin: Can't close %s", path);
return -1;
}
-#else
- /* FIXME: What about FreeBSD/MachO? */
- (void)skip_fds;
- (void)nr_skip_fds;
-
- static bool said = false;
- if (!said) {
- say_warn("popen: fdin: Skip closing inherited");
- said = true;
- }
-#endif
return 0;
}
--
2.20.1
More information about the Tarantool-patches
mailing list