diff options
| author | Markus Reiter | 2017-10-08 20:38:32 +0200 |
|---|---|---|
| committer | GitHub | 2017-10-08 20:38:32 +0200 |
| commit | b806a53d88938ab2d2aeb5e96651ed6d47efcdf9 (patch) | |
| tree | 067464b4c08f4c16ca3439b533f06669a78c370c /Library/Homebrew/utils | |
| parent | 91ab116ace7f4f97d3440190463c93be9ec6d675 (diff) | |
| parent | 175ca909ee1a5b57aa0cae2c879920511f311b14 (diff) | |
| download | brew-b806a53d88938ab2d2aeb5e96651ed6d47efcdf9.tar.bz2 | |
Merge pull request #3278 from reitermarkus/code-style
Clean up code style and remove `.rubocop_todo.yml`.
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/fork.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/utils/fork.rb b/Library/Homebrew/utils/fork.rb index 2f2a403e2..57ddbfae2 100644 --- a/Library/Homebrew/utils/fork.rb +++ b/Library/Homebrew/utils/fork.rb @@ -14,7 +14,7 @@ module Utils read.close write.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) yield - rescue Exception => e + rescue Exception => e # rubocop:disable Lint/RescueException Marshal.dump(e, write) write.close exit! @@ -26,8 +26,11 @@ module Utils ignore_interrupts(:quietly) do # the child will receive the interrupt and marshal it back begin socket = server.accept_nonblock + # rubocop:disable Lint/ShadowedException + # FIXME: https://github.com/bbatsov/rubocop/issues/4843 rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR retry unless Process.waitpid(pid, Process::WNOHANG) + # rubocop:enable Lint/ShadowedException else socket.send_io(write) socket.close @@ -36,7 +39,7 @@ module Utils data = read.read read.close Process.wait(pid) unless socket.nil? - raise Marshal.load(data) unless data.nil? || data.empty? + raise Marshal.load(data) unless data.nil? || data.empty? # rubocop:disable Security/MarshalLoad raise Interrupt if $CHILD_STATUS.exitstatus == 130 raise "Forked child process failed: #{$CHILD_STATUS}" unless $CHILD_STATUS.success? end |
