Use new sandbox2::Comms ctor for default connection params

This change allows Sandbox2 to change how the default FD for comms is chosen.

PiperOrigin-RevId: 479521810
Change-Id: Ia2ca1df95eb21783207ffb625c924790de20480d
This commit is contained in:
Sandboxed API Team 2022-10-07 01:44:11 -07:00 committed by Copybara-Service
parent 3198ff06d3
commit 859e282d3b

View File

@ -423,7 +423,7 @@ ABSL_ATTRIBUTE_WEAK int main(int argc, char* argv[]) {
// same FD, although this is not true. During process setup `dup2()` will be // same FD, although this is not true. During process setup `dup2()` will be
// called to replace the FD `kSandbox2ClientCommsFD`. // called to replace the FD `kSandbox2ClientCommsFD`.
// We do not use a new comms object here as the destructor would close our FD. // We do not use a new comms object here as the destructor would close our FD.
sandbox2::Comms comms{sandbox2::Comms::kSandbox2ClientCommsFD}; sandbox2::Comms comms{sandbox2::Comms::kDefaultConnection};
sandbox2::ForkingClient s2client{&comms}; sandbox2::ForkingClient s2client{&comms};
// Forkserver loop. // Forkserver loop.