Skip to content

Commit 9a07b87

Browse files
authored
Merge pull request uutils#8458 from cakebaker/chmod_remove_cfgs
chmod: remove Windows function & unnecessary cfgs
2 parents 06c64b7 + 7823518 commit 9a07b87

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

src/uu/chmod/src/chmod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use uucore::display::Quotable;
1515
use uucore::error::{ExitCode, UError, UResult, USimpleError, UUsageError, set_exit_code};
1616
use uucore::fs::display_permissions_unix;
1717
use uucore::libc::mode_t;
18-
#[cfg(not(windows))]
1918
use uucore::mode;
2019
use uucore::perms::{TraverseSymlinks, configure_symlink_and_recursion};
2120
use uucore::{format_usage, show, show_error};
@@ -375,20 +374,10 @@ impl Chmoder {
375374
}
376375
}
377376

378-
#[cfg(windows)]
379-
fn chmod_file(&self, file: &Path) -> UResult<()> {
380-
// chmod is useless on Windows
381-
// it doesn't set any permissions at all
382-
// instead it just sets the readonly attribute on the file
383-
Ok(())
384-
}
385-
386-
#[cfg(unix)]
387377
fn chmod_file(&self, file: &Path) -> UResult<()> {
388378
self.chmod_file_internal(file, self.dereference)
389379
}
390380

391-
#[cfg(unix)]
392381
fn chmod_file_internal(&self, file: &Path, dereference: bool) -> UResult<()> {
393382
use uucore::{mode::get_umask, perms::get_metadata};
394383

@@ -484,7 +473,6 @@ impl Chmoder {
484473
Ok(())
485474
}
486475

487-
#[cfg(unix)]
488476
fn change_file(&self, fperm: u32, mode: u32, file: &Path) -> Result<(), i32> {
489477
if fperm == mode {
490478
if self.verbose && !self.changes {

0 commit comments

Comments
 (0)