Skip to content

Commit 4f9b0c0

Browse files
iburaky2sylvestre
authored andcommitted
Fix location of cfg in touch
1 parent 3bdb63f commit 4f9b0c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/uu/touch/src/touch.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ pub fn touch(files: &[InputFile], opts: &Options) -> Result<(), TouchError> {
378378
(atime, mtime)
379379
}
380380
Source::Now => {
381-
#[cfg(unix)]
382381
let now: FileTime;
382+
#[cfg(unix)]
383383
{
384384
if opts.date.is_none() {
385385
now = FileTime::from_unix_time(0, libc::UTIME_NOW as u32);
@@ -388,7 +388,9 @@ pub fn touch(files: &[InputFile], opts: &Options) -> Result<(), TouchError> {
388388
}
389389
}
390390
#[cfg(not(unix))]
391-
let now = datetime_to_filetime(&Local::now());
391+
{
392+
now = datetime_to_filetime(&Local::now());
393+
}
392394
(now, now)
393395
}
394396
&Source::Timestamp(ts) => (ts, ts),

0 commit comments

Comments
 (0)