diff options
author | Lamont Granquist <lamont@opscode.com> | 2013-06-14 11:18:09 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@opscode.com> | 2013-06-14 11:18:09 -0700 |
commit | 8e77a79241a10fd0b4abcb183bc65c03083d4eec (patch) | |
tree | d28daee8ee5f0f207d5002850ae9c738457757e1 | |
parent | b2878614b555148a4f79bf9dbc04ab3475b8c0a9 (diff) | |
download | mixlib-shellout-8e77a79241a10fd0b4abcb183bc65c03083d4eec.tar.gz |
close observed to throw EBADF
- Unsure how File.for_fd() succeeds and then then #close on the File
throws this, but it must be racing with something. I don't think
we care.
-rw-r--r-- | lib/mixlib/shellout/unix.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mixlib/shellout/unix.rb b/lib/mixlib/shellout/unix.rb index bd20ffb..55a0372 100644 --- a/lib/mixlib/shellout/unix.rb +++ b/lib/mixlib/shellout/unix.rb @@ -194,8 +194,11 @@ module Mixlib # create a file because error pipe will auto close when we # try to create a file since it's set to CLOEXEC. if n != @process_status_pipe.last.to_i - fd = File.for_fd(n) rescue nil - fd.close if fd + begin + fd = File.for_fd(n) + fd.close if fd + rescue + end end end end |