ping(8) doesn't know the value of HZ and shouldn't round the timeout
up.  The kernel will do the right thing anyway.

Not sure if the warning here is useful either.  If the period is too
small it will just fire less often.  We could add a warning about it
in CAVEATS in ping.8...

Preferences?

Index: ping.c
===================================================================
RCS file: /cvs/src/sbin/ping/ping.c,v
retrieving revision 1.236
diff -u -p -r1.236 ping.c
--- ping.c      28 Jun 2019 13:32:45 -0000      1.236
+++ ping.c      19 Jul 2019 15:19:49 -0000
@@ -343,11 +343,6 @@ main(int argc, char *argv[])
                            (long)((intval - interval.tv_sec) * 1000000);
                        if (interval.tv_sec < 0)
                                errx(1, "illegal timing interval %s", optarg);
-                       /* less than 1/Hz does not make sense */
-                       if (interval.tv_sec == 0 && interval.tv_usec < 10000) {
-                               warnx("too small interval, raised to 0.01");
-                               interval.tv_usec = 10000;
-                       }
                        options |= F_INTERVAL;
                        break;
                case 'L':

Reply via email to