mixlib-shellout 1.4.0.rc.0-x86-mingw32 → 1.4.0.rc.1-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mixlib/shellout/unix.rb +17 -1
- data/lib/mixlib/shellout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c636ce711bd854e4be3cdf2787495492db3073d
|
4
|
+
data.tar.gz: 1a27d08ae83ffca194ba8b61a6c23824b248b2bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6b55aec1076a36b9c438e76a0a8ed39f7776bbf90d39175a6d339cad359e257d1a06106d44360218ba2b8a23f90c80b7eccd41876189b6b4d77c1e73d4a42fb
|
7
|
+
data.tar.gz: 557b314096cbe7f16aae32919d51b266c0bed4f44d20bc75b343d042add8c9ba79b6915d7be8b1ee5625573b2a867569f0e0de1f97e1e52dd096aee61d662a4e
|
data/lib/mixlib/shellout/unix.rb
CHANGED
@@ -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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|