Skip to content

Commit

Permalink
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions truffle/src/main/ruby/core/shims.rb
Original file line number Diff line number Diff line change
@@ -36,10 +36,18 @@ def external_encoding

if STDOUT.tty?
STDOUT.sync = true
else
at_exit do
STDOUT.flush
end
end

if STDERR.tty?
STDERR.sync = true
else
at_exit do
STDERR.flush
end
end

ARGF = Object.new

4 comments on commit 9e518a1

@eregon
Copy link
Member

@eregon eregon commented on 9e518a1 May 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done unconditionally on any possible exit, at_exit hooks will not run with Kernel#exit! for instance.

@eregon
Copy link
Member

@eregon eregon commented on 9e518a1 May 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is a shim, so it's fine, might just be worth a comment.

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add a Truffle::Primitive.at_exit_always.

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6b59f27

Please sign in to comment.