gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 258/282: tests: use native Sleep function as fallback on Windows


From: gnunet
Subject: [gnurl] 258/282: tests: use native Sleep function as fallback on Windows
Date: Wed, 01 Apr 2020 14:32:03 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit a6fed41f6f12f3b71cfe85609f02a294b972d3d3
Author: Marc Hoersken <address@hidden>
AuthorDate: Sat Mar 7 11:01:57 2020 +0100

    tests: use native Sleep function as fallback on Windows
    
    Reviewed-By: Daniel Stenberg
    Closes #5054
---
 tests/ftp.pm | 9 +++++++--
 1 file 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);

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]