mixlib-shellout 1.4.0.rc.0-x86-mingw32 → 1.4.0.rc.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6982a3f776c89a117273e34a9207226ae91d430
4
- data.tar.gz: bed2f4cda27c43e7f4a8bd1265089bf7b8016065
3
+ metadata.gz: 6c636ce711bd854e4be3cdf2787495492db3073d
4
+ data.tar.gz: 1a27d08ae83ffca194ba8b61a6c23824b248b2bd
5
5
  SHA512:
6
- metadata.gz: dd33a078724263f3aec8d63518c0b7c67883e0fca6b8a359b3ca573228ba6a194032305dfa85b2f55b901c4c0b9dcdf877908170d590bcebb30f947e3777cd1f
7
- data.tar.gz: 5c7af3ef8b2bb9f5e7ef9e36dce50f94afc0d3ce56702ac6e6bd45343cc367fe057ea7ad8b04881e6d0aaaebcaffd45ae95f9d69bf3e36ea385127f2f023b61b
6
+ metadata.gz: a6b55aec1076a36b9c438e76a0a8ed39f7776bbf90d39175a6d339cad359e257d1a06106d44360218ba2b8a23f90c80b7eccd41876189b6b4d77c1e73d4a42fb
7
+ data.tar.gz: 557b314096cbe7f16aae32919d51b266c0bed4f44d20bc75b343d042add8c9ba79b6915d7be8b1ee5625573b2a867569f0e0de1f97e1e52dd096aee61d662a4e
@@ -63,7 +63,7 @@ module Mixlib
63
63
  # CHEF-3390: Marshall.load on Ruby < 1.8.7p369 also has a GC bug related
64
64
  # to Marshall.load, so try disabling GC first.
65
65
  propagate_pre_exec_failure
66
- @child_pgid = -Process.getpgid(@child_pid)
66
+ get_child_pgid
67
67
 
68
68
  @result = nil
69
69
  @execution_time = 0
@@ -107,6 +107,18 @@ module Mixlib
107
107
 
108
108
  private
109
109
 
110
+ def get_child_pgid
111
+ # The behavior of Process.getpgid (see also getpgid(2) ) when the
112
+ # argument is the pid of a zombie isn't well specified. On Linux it
113
+ # works, on OS X it returns ESRCH (which ruby turns into Errno::ESRCH).
114
+ #
115
+ # If the child dies very quickly, @child_pid may be a zombie, so handle
116
+ # ESRCH here.
117
+ @child_pgid = -Process.getpgid(@child_pid)
118
+ rescue Errno::ESRCH
119
+ @child_pgid = nil
120
+ end
121
+
110
122
  def set_user
111
123
  if user
112
124
  Process.euid = uid
@@ -137,6 +149,10 @@ module Mixlib
137
149
 
138
150
  # Process group id of the child. Returned as a negative value so you can
139
151
  # put it directly in arguments to kill, wait, etc.
152
+ #
153
+ # This may be nil if the child dies before the parent can query the
154
+ # system for its pgid (on some systems it is an error to get the pgid of
155
+ # a zombie).
140
156
  def child_pgid
141
157
  @child_pgid
142
158
  end
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class ShellOut
3
- VERSION = "1.4.0.rc.0"
3
+ VERSION = "1.4.0.rc.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-shellout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.rc.0
4
+ version: 1.4.0.rc.1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Opscode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-30 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec