Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
bzEq committed Dec 6, 2022
1 parent d9ea421 commit 33fd260
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/std/src/sys/unix/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
super::unsupported::unsupported()
}

#[cfg(target_os = "fuchsia", target_os = "aix")]
#[cfg(any(target_os = "fuchsia", target_os = "aix"))]
pub fn current_exe() -> io::Result<PathBuf> {
use crate::io::ErrorKind;

Expand All @@ -469,7 +469,11 @@ pub fn current_exe() -> io::Result<PathBuf> {

// Prepend the current working directory to the path if it's not absolute.
if cfg!(target_os = "fuchsia") {
if !path.is_absolute() { getcwd().map(|cwd| cwd.join(path)) } else { Ok(path) }
if !path.is_absolute() {
return getcwd().map(|cwd| cwd.join(path));
} else {
return Ok(path);
}
}

if path.is_absolute() {
Expand Down

0 comments on commit 33fd260

Please sign in to comment.