Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,12 +1896,13 @@ pub(crate) fn copy_attributes(
fn symlink_file(
source: &Path,
dest: &Path,
symlinked_files: &mut HashSet<FileInformation>,
#[cfg(not(target_os = "wasi"))] symlinked_files: &mut HashSet<FileInformation>,
#[cfg(target_os = "wasi")] _symlinked_files: &mut HashSet<FileInformation>,
) -> CopyResult<()> {
#[cfg(target_os = "wasi")]
{
return Err(CpError::IoErrContext(
std::io::Error::new(std::io::ErrorKind::Unsupported, "symlinks not supported"),
io::Error::new(io::ErrorKind::Unsupported, "symlinks not supported"),
translate!("cp-error-cannot-create-symlink",
"dest" => get_filename(dest).unwrap_or("?").quote(),
"source" => get_filename(source).unwrap_or("?").quote()),
Expand Down Expand Up @@ -1930,10 +1931,13 @@ fn symlink_file(
)
})?;
}
if let Ok(file_info) = FileInformation::from_path(dest, false) {
symlinked_files.insert(file_info);
#[cfg(not(target_os = "wasi"))]
{
if let Ok(file_info) = FileInformation::from_path(dest, false) {
symlinked_files.insert(file_info);
}
Ok(())
}
Ok(())
}

fn context_for(src: &Path, dest: &Path) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/mv/src/mv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ fn rename_symlink_fallback(from: &Path, to: &Path) -> io::Result<()> {
}

#[cfg(target_os = "wasi")]
fn rename_symlink_fallback(from: &Path, to: &Path) -> io::Result<()> {
fn rename_symlink_fallback(_from: &Path, _to: &Path) -> io::Result<()> {
Err(io::Error::new(
io::ErrorKind::Other,
translate!("mv-error-no-symlink-support"),
Expand Down
4 changes: 4 additions & 0 deletions src/uu/wc/src/countable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub trait WordCountable: AsFd + AsRawFd + Read {
pub trait WordCountable: Read {
type Buffered: BufRead;
fn buffered(self) -> Self::Buffered;
#[cfg(not(target_os = "wasi"))]
fn inner_file(&mut self) -> Option<&mut File>;
}

Expand All @@ -40,6 +41,8 @@ impl WordCountable for StdinLock<'_> {
fn buffered(self) -> Self::Buffered {
self
}

#[cfg(not(target_os = "wasi"))]
fn inner_file(&mut self) -> Option<&mut File> {
None
}
Expand All @@ -62,6 +65,7 @@ impl WordCountable for File {
BufReader::new(self)
}

#[cfg(not(target_os = "wasi"))]
fn inner_file(&mut self) -> Option<&mut File> {
Some(self)
}
Expand Down
Loading