]> jfr.im git - irc/freenode/solanum.git/commitdiff
librb/helper: call rb_clear_cloexec on child fds
authorDoug Freed <redacted>
Sun, 13 Dec 2020 08:41:13 +0000 (08:41 +0000)
committerDoug Freed <redacted>
Tue, 26 Jan 2021 05:03:48 +0000 (00:03 -0500)
librb/src/helper.c

index 11d47358e8510da293e47732c026ea5df21fe3b1..ddc71343152a8bbe014265056af4263c5561d875 100644 (file)
@@ -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);