Skip to content

Commit

Permalink
Use OsFile in c-api
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Jun 7, 2020
1 parent d6e5001 commit 3dcb495
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/c-api/src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn create_snapshot0_instance(store: &Store, config: wasi_config_t) -> Result<Was

fn wasi_preview_builder(config: wasi_config_t) -> Result<WasiPreview1CtxBuilder> {
use std::convert::TryFrom;
use wasi_common::OsOther;
use wasi_common::OsFile;
let mut builder = WasiPreview1CtxBuilder::new();
if config.inherit_args {
builder.inherit_args();
Expand All @@ -254,17 +254,17 @@ fn wasi_preview_builder(config: wasi_config_t) -> Result<WasiPreview1CtxBuilder>
if config.inherit_stdin {
builder.inherit_stdin();
} else if let Some(file) = config.stdin {
builder.stdin(OsOther::try_from(file)?);
builder.stdin(OsFile::try_from(file)?);
}
if config.inherit_stdout {
builder.inherit_stdout();
} else if let Some(file) = config.stdout {
builder.stdout(OsOther::try_from(file)?);
builder.stdout(OsFile::try_from(file)?);
}
if config.inherit_stderr {
builder.inherit_stderr();
} else if let Some(file) = config.stderr {
builder.stderr(OsOther::try_from(file)?);
builder.stderr(OsFile::try_from(file)?);
}
for preopen in config.preopens {
builder.preopened_dir(preopen.0, preopen.1);
Expand Down

0 comments on commit 3dcb495

Please sign in to comment.