🔒️ Move away from std::env::set_var, which is unsound

This commit is contained in:
Lucy 2022-06-24 14:46:14 -04:00
parent fb1a832916
commit c84857ae9b
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
4 changed files with 12 additions and 6 deletions

View file

@ -37,9 +37,11 @@ async fn main() -> Result<()> {
.await
.expect("failed to get WAYLAND_SOCKET");
info!("got WAYLAND_SOCKET: {}", wayland_socket);
std::env::set_var("WAYLAND_SOCKET", wayland_socket);
tokio::spawn(panel::run_panel(token.child_token()));
tokio::spawn(panel::run_panel(
token.child_token(),
wayland_socket.clone(),
));
let mut signals = Signals::new(vec![libc::SIGTERM, libc::SIGINT]).unwrap();
while let Some(signal) = signals.next().await {