From 71325a9801d26a33d914b8dd3aa428a621445c11 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Sun, 13 Dec 2020 08:41:13 +0000 Subject: [PATCH] librb/helper: call rb_clear_cloexec on child fds --- librb/src/helper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/librb/src/helper.c b/librb/src/helper.c index 11d47358..ddc71343 100644 --- a/librb/src/helper.c +++ b/librb/src/helper.c @@ -148,10 +148,8 @@ rb_helper_start(const char *name, const char *fullpath, rb_helper_cb * read_cb, parv[0] = buf; parv[1] = NULL; -#ifdef _WIN32 - SetHandleInformation((HANDLE) rb_get_fd(in_f[1]), HANDLE_FLAG_INHERIT, 1); - SetHandleInformation((HANDLE) rb_get_fd(out_f[0]), HANDLE_FLAG_INHERIT, 1); -#endif + rb_clear_cloexec(in_f[1]); + rb_clear_cloexec(out_f[0]); pid = rb_spawn_process(fullpath, (const char **)parv);