From e0cdea9bb64245ce1692ef14d19138dc8cc9c4f2 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 7 Jan 2020 17:02:04 -0800 Subject: [PATCH] Correct the usleep calculation in fish_test_helper 'fish_test_helper print_pid_then_sleep' tried to sleep for .5 seconds, but instead it divided by .5 so it actually slept for 2 seconds. This exceeds the maximum value on NetBSD so it wasn't sleeping at all there. Fixes #6476 --- src/fish_test_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fish_test_helper.cpp b/src/fish_test_helper.cpp index a1590487d..b434d93a1 100644 --- a/src/fish_test_helper.cpp +++ b/src/fish_test_helper.cpp @@ -50,7 +50,7 @@ static void print_stdout_stderr() { static void print_pid_then_sleep() { fprintf(stdout, "%d\n", getpid()); fflush(nullptr); - usleep(1000000 / .5); //.5 secs + usleep(1000000 / 2); //.5 secs } static void print_pgrp() { fprintf(stdout, "%d\n", getpgrp()); }