diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2020-03-07 11:01:57 +0100 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2020-03-07 11:02:43 +0100 |
commit | a6fed41f6f12f3b71cfe85609f02a294b972d3d3 (patch) | |
tree | 2897ca38059b94951a51e331578eee01bff0ad8f /tests | |
parent | 99c688ba215aeee10a65b998a6f15e984e100ff8 (diff) |
tests: use native Sleep function as fallback on Windows
Reviewed-By: Daniel Stenberg
Closes #5054
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ftp.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/ftp.pm b/tests/ftp.pm index f7298bce6..5e92ce7f9 100644 --- a/tests/ftp.pm +++ b/tests/ftp.pm @@ -25,6 +25,11 @@ BEGIN { eval { no warnings "all"; require Time::HiRes; + }; + # portable sleeping falls back to native Sleep on Win32 + eval { + no warnings "all"; + require Win32; } } @@ -50,8 +55,8 @@ sub portable_sleep { if($Time::HiRes::VERSION) { Time::HiRes::sleep($seconds); } - elsif ($seconds > 1 && ($^O eq 'MSWin32' || $^O eq 'msys')) { - sleep($seconds); + elsif ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys') { + Win32::Sleep($seconds*1000); } else { select(undef, undef, undef, $seconds); |