Skip to content

Commit 57bbc7f

Browse files
committed
Change cfg gates in touch near libc::UTIME_NOW from unix to linux
1 parent 4792e54 commit 57bbc7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/uu/touch/src/touch.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::io::{Error, ErrorKind};
2323
use std::path::{Path, PathBuf};
2424
use uucore::display::Quotable;
2525
use uucore::error::{FromIo, UResult, USimpleError};
26-
#[cfg(unix)]
26+
#[cfg(target_os = "linux")]
2727
use uucore::libc;
2828
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
2929
use uucore::translate;
@@ -380,15 +380,15 @@ pub fn touch(files: &[InputFile], opts: &Options) -> Result<(), TouchError> {
380380
}
381381
Source::Now => {
382382
let now: FileTime;
383-
#[cfg(unix)]
383+
#[cfg(target_os = "linux")]
384384
{
385385
if opts.date.is_none() {
386386
now = FileTime::from_unix_time(0, libc::UTIME_NOW as u32);
387387
} else {
388388
now = datetime_to_filetime(&Local::now());
389389
}
390390
}
391-
#[cfg(not(unix))]
391+
#[cfg(not(target_os = "linux"))]
392392
{
393393
now = datetime_to_filetime(&Local::now());
394394
}

0 commit comments

Comments
 (0)