Skip to content

Use Duration based uptime across uucore #7926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

irbeam256
Copy link

@irbeam256 irbeam256 commented May 12, 2025

Closes #7851

Changes the i64 based uptime returned by uucore's get_uptime into an std::time::Duration and updates callsites.

  • get_uptime modified to accept fractional seconds from /proc/uptime and return Duration
  • Callsites in uucore/.../features/uptime.rs and uu/.../uptime.rs use Duration

@sylvestre
Copy link
Contributor

you probably noticed that a few jobs are failing

@irbeam256
Copy link
Author

you probably noticed that a few jobs are failing

Oh yes, just getting a draft PR on the issue now while I work on it, this commit won't build yet. I'll mark ready for review when it's good enough to look at.

@irbeam256 irbeam256 force-pushed the 7851_uptime_duration branch from c59820d to 177fae1 Compare May 13, 2025 01:13
@irbeam256
Copy link
Author

This PR depends on the changes in #7910 so once that is merged I can rebase this branch on main.

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

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.

uptime: uucore/get_uptime should return a Duration
2 participants