Page MenuHomeFreeBSD

ping: Use setitimer(2) instead of obsoleted alarm(3)
ClosedPublic

Authored by sucanjan_gmail.com on Oct 22 2019, 7:24 AM.

Details

Summary

Use setitimer(2) instead of obsoleted alarm(3)

Submitted by: Ján Sučan <sucanjan@gmail.com>

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

asomers requested changes to this revision.Wed, Nov 13, 3:32 PM

What about ping6.c? It has a similar invocation of alarm.

sbin/ping/ping.c
511 ↗(On Diff #63529)

The other fields of itv are set to stack garbage. You should zero them.

This revision now requires changes to proceed.Wed, Nov 13, 3:32 PM

Use setitimer(2) instead of obsoleted alarm(3)

Submitted by: Ján Sučan <sucanjan@gmail.com>

I did the same for ping6. I was not sure whether to do that in this diff or in a separate one.

sbin/ping/ping.c
511 ↗(On Diff #63529)

Thanks. Fixed.

asomers accepted this revision.Tue, Nov 26, 5:02 AM

LGTM. The extra braces you added in order to create scope for the itv variable are stylistically contentious. Some people would disagree with that, because it's not commonly done. But I happen to like that technique myself; no reason for itv to have more scope than necessary.

This revision is now accepted and ready to land.Tue, Nov 26, 5:02 AM
This revision was automatically updated to reflect the committed changes.