Skip to content

Commit

Permalink
Always use last exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
bew committed Dec 19, 2017
1 parent 8add7cf commit 1714f66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/crystal/main.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ module Crystal
1
end

new_status = AtExitHandlers.run status
status = {new_status, status}.max
status = AtExitHandlers.run status

ex.inspect_with_backtrace STDERR if ex
STDOUT.flush
Expand Down
3 changes: 1 addition & 2 deletions src/kernel.cr
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ def exit(status = 0) : NoReturn
raise NestedExitError.new status
end

new_status = AtExitHandlers.run status
status = {status, new_status}.max
status = AtExitHandlers.run status
STDOUT.flush
STDERR.flush
Process.exit(status)
Expand Down

0 comments on commit 1714f66

Please sign in to comment.