-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
|
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. |
c59820d to
177fae1
Compare
|
This PR depends on the changes in #7910 so once that is merged I can rebase this branch on main. |
|
GNU testsuite comparison: |
| if upsecs >= 0 { | ||
| print_uptime(Some(upsecs))?; | ||
| let uptime = get_uptime(None); | ||
| if uptime.is_ok() >= 0 { |
There was a problem hiding this comment.
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 maybe if let Some(uptime) = uptime { would be easier.
|
I think 177fae1 looks good, would it be possible to rebase just that commit on |
|
it has been draft for a long time, please reopen when ready |
Closes #7851
Changes the
i64based uptime returned by uucore'sget_uptimeinto anstd::time::Durationand updates callsites.get_uptimemodified to accept fractional seconds from/proc/uptimeand returnDurationuucore/.../features/uptime.rsanduu/.../uptime.rsuse Duration