diff options
author | danielsdeleo <dan@opscode.com> | 2013-06-26 14:54:48 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-06-26 17:50:12 -0700 |
commit | 82d86afbe6651c23160c9754b3c17b2dd78d5aa0 (patch) | |
tree | f681032c0c0f32bccb6ee0f6bddb0a83bd09fa15 /lib | |
parent | 4028eb336612d410d9cc5ff4c666b428bd3ff684 (diff) | |
download | ohai-82d86afbe6651c23160c9754b3c17b2dd78d5aa0.tar.gz |
Reap processes and close fds when exec fails
Fixes OHAI-455: http://tickets.opscode.com/browse/OHAI-455
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ohai/mixin/command.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ohai/mixin/command.rb b/lib/ohai/mixin/command.rb index 4487e3bf..a719e274 100644 --- a/lib/ohai/mixin/command.rb +++ b/lib/ohai/mixin/command.rb @@ -224,6 +224,10 @@ module Ohai begin e = Marshal.load ps.first + pw.last.close + pr.first.close + pe.first.close + Process.wait(cid) raise(Exception === e ? e : "unknown failure!") rescue EOFError # If we get an EOF error, then the exec was successful 42 |