We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
writer.close_on_finalize = false
1 parent 847c0ce commit 4fa3719Copy full SHA for 4fa3719
src/crystal/system/unix/signal.cr
@@ -12,7 +12,14 @@ module Crystal::System::Signal
12
13
alias Handler = ::Signal ->
14
15
- @@pipe = IO.pipe(read_blocking: false, write_blocking: true)
+ @@pipe : {IO::FileDescriptor, IO::FileDescriptor} = begin
16
+ IO.pipe(read_blocking: false, write_blocking: true).tap do |reader, writer|
17
+ # This avoids accidentally closing the pipe from the interpreter.
18
+ # See https://github.com/crystal-lang/crystal/issues/16040 for details.
19
+ writer.close_on_finalize = false
20
+ end
21
22
+
23
@@handlers = {} of ::Signal => Handler
24
@@sigset = Sigset.new
25
class_property child_handler : Handler?
0 commit comments