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

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