You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
614 B

  1. --- a/programs/pluto/send.c
  2. +++ b/programs/pluto/send.c
  3. @@ -26,7 +26,7 @@
  4. *
  5. */
  6. -#include <unistd.h> /* for usleep() */
  7. +#include <time.h> /* for nanosleep() */
  8. #include <errno.h>
  9. #include "defs.h"
  10. @@ -172,7 +172,8 @@
  11. /* Send a duplicate packet when this impair is enabled - used for testing */
  12. if (IMPAIR(JACOB_TWO_TWO)) {
  13. /* sleep for half a second, and second another packet */
  14. - usleep(500000);
  15. + const struct timespec req = {0, 500 * 1000 * 1000};
  16. + nanosleep(&req, NULL);
  17. endpoint_buf b;
  18. endpoint_buf ib;
  19. DBG_log("JACOB 2-2: resending %zu bytes for %s through %s from %s to %s:",