From 8bab9f1bea622532ab903591af41a40c4ad9d591 Mon Sep 17 00:00:00 2001 From: Lachlan Sneff Date: Mon, 1 Apr 2019 17:25:45 -0700 Subject: [PATCH] init zbox first --- lib/wasi/src/state.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/wasi/src/state.rs b/lib/wasi/src/state.rs index ce4139e01..ae2ef12af 100644 --- a/lib/wasi/src/state.rs +++ b/lib/wasi/src/state.rs @@ -10,8 +10,9 @@ use std::{ ops::{Index, IndexMut}, rc::Rc, time::SystemTime, + path::PathBuf, }; -use zbox::{File, FileType, OpenOptions, Repo, RepoOpener}; +use zbox::{File, FileType, OpenOptions, Repo, RepoOpener, init_env as zbox_init_env}; pub const MAX_SYMLINKS: usize = 100; @@ -57,10 +58,11 @@ pub struct WasiFs { impl WasiFs { pub fn new() -> Result { + zbox_init_env(); Ok(Self { repo: RepoOpener::new() .create(true) - .open("mem://not-an-emoji", "very unsafe pwd") + .open("mem://foo", "") .map_err(|e| e.to_string())?, name_map: HashMap::new(), inodes: Arena::new(),