Project

General

Profile

Actions

Misc #14907

closed

[PATCH] io.c: do not close inherited FDs by default

Added by normalperson (Eric Wong) over 5 years ago. Updated over 5 years ago.

Status:
Closed
[ruby-core:87904]

Description

io.c: do not close inherited FDs by default

While I fully agree Ruby should create FDs with close-on-exec by
default (as it has since 2.0.0); I don't believe Ruby should be
arbitrarily closing file descriptors it does not know about.

The following is an example (using mwrap[1]) where closing
inherited FDs is harmful.

MWRAP=dump_fd:99 mwrap make -j4 exam 99>>mwrap.out

I only found one minor regression from this change in
test/lib/test/unit.rb as IO.new does not set close-on-exec
when using jobserver FDs from make. A possible change
is to make IO.new set FD_CLOEXEC by default.

[1] https://80x24.org/mwrap/README.html


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0