From c8f206d0f305c18a924eac4e36fa295a2aa11402 Mon Sep 17 00:00:00 2001 From: Ulf Nilsson Date: Sat, 9 Apr 2016 14:30:14 +0200 Subject: [PATCH] Propagate RUST_BACKTRACE to content processes --- components/compositing/constellation.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 84970bc1a90..ad97678fe81 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -468,6 +468,11 @@ impl Constellation let child_process = if opts::get().sandbox { let mut command = sandbox::Command::me().expect("Failed to get current sandbox."); command.arg("--content-process").arg(token); + + if let Ok(value) = env::var("RUST_BACKTRACE") { + command.env("RUST_BACKTRACE", value); + } + let profile = sandboxing::content_process_sandbox_profile(); ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command) .expect("Failed to start sandboxed child process!")) @@ -477,6 +482,11 @@ impl Constellation let mut child_process = process::Command::new(path_to_self); child_process.arg("--content-process"); child_process.arg(token); + + if let Ok(value) = env::var("RUST_BACKTRACE") { + child_process.env("RUST_BACKTRACE", value); + } + ChildProcess::Unsandboxed(child_process.spawn() .expect("Failed to start unsandboxed child process!")) };