Page MenuHomeFreeBSD

ping6: Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC)
ClosedPublic

Authored by jansucan on Aug 12 2019, 11:53 AM.
Tags
None
Referenced Files
F170793159: D21226.id60673.diff
Sun, Sep 6, 4:09 PM
Unknown Object (File)
Sun, Sep 6, 1:20 PM
Unknown Object (File)
Sun, Sep 6, 4:55 AM
Unknown Object (File)
Sat, Sep 5, 6:02 PM
Unknown Object (File)
Sat, Sep 5, 3:49 AM
Unknown Object (File)
Fri, Sep 4, 5:01 AM
Unknown Object (File)
Thu, Sep 3, 10:22 AM
Unknown Object (File)
Wed, Sep 2, 4:25 AM
Subscribers

Details

Summary

Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC)

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25825
Build 24397: arc lint + arc unit

Event Timeline

asomers requested changes to this revision.Aug 12 2019, 7:34 PM

Thanks for fixing this. This will be a good change.

sbin/ping6/ping6.c
2210–2211

You should eliminate this function and use timespecsub(3) instead.

This revision now requires changes to proceed.Aug 12 2019, 7:34 PM

Use timespecsub(3) instead of a private function.

sbin/ping6/ping6.c
2210–2211

Fixed.

Annotate truncating of time values saved in a packet.

asomers requested changes to this revision.Aug 13 2019, 3:10 PM
asomers added inline comments.
sbin/ping6/ping6.c
1151–1153

These 10 lines can be replaced by timespecadd.

This revision now requires changes to proceed.Aug 13 2019, 3:10 PM

Use timespecadd(), timespecsub(), and timespecclear().

sbin/ping6/ping6.c
1151–1153

Fixed.

asomers added inline comments.
sbin/ping6/ping6.c
1151–1153

Thanks. It's much more readable now.

This revision is now accepted and ready to land.Aug 13 2019, 7:22 PM