Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"certstore",
"CFPREFERENCES",
"cfprefsd",
"cgroupv",
"chaput",
"chardev",
"chatops",
Expand Down Expand Up @@ -333,6 +334,7 @@
"dscacheutil",
"dscresource",
"dslocal",
"ducktype",
"DUPEUX",
"DWORDLONG",
"DYNALINK",
Expand All @@ -358,6 +360,7 @@
"encap",
"Encryptor",
"encryptor",
"endgrent",
"endlocal",
"entriesread",
"envdata",
Expand Down Expand Up @@ -451,6 +454,7 @@
"GETFD",
"GETFL",
"getgr",
"getgrent",
"getgrgid",
"getgrnam",
"gethostbyname",
Expand Down Expand Up @@ -704,6 +708,7 @@
"loginclass",
"loginwindow",
"LOGLOCATION",
"LOGNAME",
"logopts",
"logstring",
"LONGLONG",
Expand Down Expand Up @@ -1017,6 +1022,7 @@
"PFILETIME",
"PFLOAT",
"PGENERICMAPPING",
"pgid",
"phabricator",
"PHALF",
"PHANDLE",
Expand Down Expand Up @@ -1245,6 +1251,8 @@
"Scriptable",
"SCROLLBAR",
"SCROLLBARS",
"secondarygroups",
"seconderies",
"secontext",
"secoption",
"secopts",
Expand Down Expand Up @@ -1291,6 +1299,7 @@
"SETTINGCHANGE",
"setuid",
"SETX",
"sgids",
"SHARENAME",
"SHAs",
"shas",
Expand Down Expand Up @@ -1626,6 +1635,7 @@
"WINVER",
"WKSTA",
"WMIGUID",
"WNOHANG",
"woot",
"workdir",
"WPARAM",
Expand Down
1 change: 0 additions & 1 deletion lib/mixlib/shellout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#

require "etc" unless defined?(Etc)
require "tmpdir" unless defined?(Dir.mktmpdir)
require "fcntl"
require_relative "shellout/exceptions"

Expand Down
8 changes: 5 additions & 3 deletions lib/mixlib/shellout/unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# limitations under the License.
#

require "fileutils" unless defined?(FileUtils)

module Mixlib
class ShellOut
module Unix
Expand Down Expand Up @@ -112,7 +110,7 @@ def run_command
unless ready_buffers
@execution_time += READ_WAIT_TIME
if @execution_time >= timeout && !@result
# kill the bad proccess
# kill the bad process
reap_errant_child
# read anything it wrote when we killed it
attempt_buffer_read
Expand Down Expand Up @@ -324,6 +322,10 @@ def cgroupv2_available?
def fork_subprocess
initialize_ipc

# FileUtils is only used by #set_cgroup. Load it here, in the parent, rather
# than post-fork where acquiring the require lock is not guaranteed safe.
require "fileutils" if cgroup && !defined?(FileUtils)

fork do
# Child processes may themselves fork off children. A common case
# is when the command is given as a single string (instead of
Expand Down
Loading