Fix path_remove_directory on *nixes

This commit is contained in:
Jakub Konka
2019-09-17 22:34:32 +02:00
parent 30a4f73cce
commit 90f1cd5c96
3 changed files with 4 additions and 2 deletions

View File

@@ -978,7 +978,9 @@ pub(crate) unsafe fn path_remove_directory(
let dirfd = wasi_ctx
.get_fd_entry(dirfd, host::__WASI_RIGHT_PATH_REMOVE_DIRECTORY, 0)
.and_then(|fe| fe.fd_object.descriptor.as_file())?;
let resolved = path_get(dirfd, 0, path, false)?;
let resolved = path_get(dirfd, 0, path, true)?;
log::debug!("path_remove_directory resolved={:?}", resolved);
hostcalls_impl::path_remove_directory(resolved)
}

View File

@@ -5,6 +5,7 @@ use crate::{host, Error, Result};
use std::fs::File;
use std::path::{Component, Path};
#[derive(Debug)]
pub(crate) struct PathGet {
dirfd: File,
path: String,