···140 link_swdir.call swdir, Pathname.new('')
141142 # New environment
143- ENV.replace(Hash[ envvars.map { |x| [x, ENV[x]] } ])
144145 # Finally, exec!
146- exec *execp
147end
148149# Wait for a child. If we catch a signal, resend it to child and continue
···140 link_swdir.call swdir, Pathname.new('')
141142 # New environment
143+ new_env = Hash[ envvars.map { |x| [x, ENV[x]] } ]
144145 # Finally, exec!
146+ exec(new_env, *execp, close_others: true, unsetenv_others: true)
147end
148149# Wait for a child. If we catch a signal, resend it to child and continue