initialize inherited FD after logging
... so that any error during the initialization can be captured in the
log.
Bug: N/A
Test: N/A
Change-Id: If678114a15d9fbba2d8d5bca9b0e343a0f2a711a
diff --git a/prng_seeder/src/main.rs b/prng_seeder/src/main.rs
index d112d61..c6adfd4 100644
--- a/prng_seeder/src/main.rs
+++ b/prng_seeder/src/main.rs
@@ -69,11 +69,11 @@
}
fn setup() -> Result<(ConditionerBuilder, UnixListener)> {
+ configure_logging()?;
+ let cli = Cli::try_parse()?;
// SAFETY: nobody has taken ownership of the inherited FDs yet.
unsafe { rustutils::inherited_fd::init_once() }
.context("In setup, failed to own inherited FDs")?;
- configure_logging()?;
- let cli = Cli::try_parse()?;
// SAFETY: Nothing else sets the signal handler, so either it was set here or it is the default.
unsafe { signal::signal(signal::Signal::SIGPIPE, signal::SigHandler::SigIgn) }
.context("In setup, setting SIGPIPE to SIG_IGN")?;