From 851de3a6c373ef0707b8284dc2c956023f33033b Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 27 Nov 2020 16:25:33 +0000 Subject: [PATCH] DevIo.pm: replace time with gettimeofday (Forum #111061) git-svn-id: https://svn.fhem.de/fhem/trunk@23241 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/DevIo.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/DevIo.pm b/fhem/FHEM/DevIo.pm index ab2c2fa18..cd7d82285 100644 --- a/fhem/FHEM/DevIo.pm +++ b/fhem/FHEM/DevIo.pm @@ -376,7 +376,7 @@ DevIo_OpenDev($$$;$) if($ret) { if($hadFD && !defined($hash->{FD})) { # Forum #54732 / ser2net DevIo_Disconnected($hash); - $hash->{NEXT_OPEN} = time() + $nextOpenDelay; + $hash->{NEXT_OPEN} = gettimeofday() + $nextOpenDelay; } else { DevIo_CloseDev($hash); @@ -476,7 +476,7 @@ DevIo_OpenDev($$$;$) # somebody is communicating over another TCP connection. As the connect # for non-existent devices has a delay of 3 sec, we are sitting all the # time in this connect. NEXT_OPEN tries to avoid this problem. - if($hash->{NEXT_OPEN} && time() < $hash->{NEXT_OPEN}) { + if($hash->{NEXT_OPEN} && gettimeofday() < $hash->{NEXT_OPEN}) { return &$doCb(undef); # Forum 53309 } @@ -497,7 +497,7 @@ DevIo_OpenDev($$$;$) $readyfnlist{"$name.$dev"} = $hash; DevIo_setStates($hash, "disconnected"); DoTrigger($name, "DISCONNECTED") if(!$reopen); - $hash->{NEXT_OPEN} = time() + $nextOpenDelay; + $hash->{NEXT_OPEN} = gettimeofday() + $nextOpenDelay; return 0; }