From 995fb44ecea3524f826866a99d00e3b2b9018c97 Mon Sep 17 00:00:00 2001 From: Privacy Sandbox Team Date: Wed, 25 Sep 2024 21:17:01 +0000 Subject: [PATCH] feat: Move no-logging later in the code Move no logging later in the flow to get as many error messages as possible Bug: N/A Change-Id: I8a3101edf35d83175ad76c922c24d589327f5d36 GitOrigin-RevId: 1776f3b31093ca3ee501d47c425539dacdf7870e --- src/roma/byob/container/run_workers.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/roma/byob/container/run_workers.cc b/src/roma/byob/container/run_workers.cc index e973649e..a7c62d21 100644 --- a/src/roma/byob/container/run_workers.cc +++ b/src/roma/byob/container/run_workers.cc @@ -99,10 +99,6 @@ int WorkerImpl(void* arg) { PCHECK(::mount(binary_dir.c_str(), target.c_str(), nullptr, MS_BIND, nullptr) == 0); } - { - PCHECK(::dup2(worker_impl_arg.dev_null_fd, STDOUT_FILENO) != -1); - PCHECK(::dup2(worker_impl_arg.dev_null_fd, STDERR_FILENO) != -1); - } // MS_REC needed here to get other mounts (/lib, /lib64 etc) PCHECK(::mount(worker_impl_arg.pivot_root_dir.data(), @@ -136,6 +132,10 @@ int WorkerImpl(void* arg) { PCHECK(connection_fd != -1); return absl::StrCat(connection_fd); }(); + { + PCHECK(::dup2(worker_impl_arg.dev_null_fd, STDOUT_FILENO) != -1); + PCHECK(::dup2(worker_impl_arg.dev_null_fd, STDERR_FILENO) != -1); + } ::execl(worker_impl_arg.binary_path.data(), worker_impl_arg.binary_path.data(), connection_fd.c_str(), nullptr); PLOG(FATAL) << "exec '" << worker_impl_arg.binary_path << "' failed";