Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

UseDuration 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
irbeam256 wants to merge6 commits intouutils:main
base:main
Choose a base branch
Loading
fromirbeam256:7851_uptime_duration

Conversation

irbeam256
Copy link

@irbeam256irbeam256 commentedMay 12, 2025
edited
Loading

Closes#7851

Changes thei64 based uptime returned by uucore'sget_uptime into anstd::time::Duration and updates callsites.

  • get_uptime modified to accept fractional seconds from/proc/uptime and returnDuration
  • Callsites inuucore/.../features/uptime.rs anduu/.../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
Copy link
Author

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

@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

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

if upsecs >=0{
print_uptime(Some(upsecs))?;
let uptime =get_uptime(None);
if uptime.is_ok() >=0{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This can't be negative anymore, right?

So maybeif let Some(uptime) = uptime { would be easier.

@drinkcat
Copy link
Contributor

I think177fae1 looks good, would it be possible to rebase just that commit onmain? (arguably this is more important than--pretty parameter that'stechnically an extension)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@drinkcatdrinkcatdrinkcat left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

uptime: uucore/get_uptime should return aDuration
3 participants
@irbeam256@sylvestre@drinkcat

[8]ページ先頭

©2009-2025 Movatter.jp