Skip to content

Conversation

@iburaky2
Copy link
Contributor

Fixes #9844.

Current uu-touch explicitly provides the current time when updating time to now.

Time PR makes it use libc::UTIME_NOW instead on unix platforms, which requires lower permissions than explicitly providing time. See utimensat.

@sylvestre
Copy link
Contributor

fails with:

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
   --> src/uu/touch/src/touch.rs:384:55
    |
384 |                     now = FileTime::from_unix_time(0, libc::UTIME_NOW as u32);
    |                                                       ^^^^ use of undeclared crate or module `libc`
    |
help: consider importing this crate
    |
11  + use uucore::libc;
    |

For more information about this error, try `rustc --explain E0433`.

@sylvestre
Copy link
Contributor

fails now on windows

@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/pr/pr-tests was skipped on 'main' but is now failing.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/env/env-signal-handler. tests/env/env-signal-handler is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mv/i-3. tests/mv/i-3 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/stty/stty. tests/stty/stty is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/stty/stty-row-col. tests/stty/stty-row-col is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/wc/wc-cpu. tests/wc/wc-cpu is passing on 'main'. Maybe you have to rebase?

@iburaky2 iburaky2 marked this pull request as draft December 27, 2025 14:43
@iburaky2 iburaky2 marked this pull request as ready for review December 27, 2025 16:00
@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tty/tty-eof is no longer failing!

@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/cp/cp-a-selinux was skipped on 'main' but is now failing.

@sylvestre sylvestre merged commit 16c16f4 into uutils:main Dec 31, 2025
128 checks passed
sgmarz pushed a commit to sgmarz/coreutils that referenced this pull request Jan 7, 2026
* Use libc::UTIME_NOW in touch when updating time to now

* Explicit libc import to satisfy clippy

* Fix location of cfg in touch

* Add cfg gate to libc import to satisfy clippy on windows

* Change cfg gates in touch near libc::UTIME_NOW from unix to linux

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

touch: touch /dev/full should not be error

2 participants