From c2b622e375a2060e52c8d1097a3eb74d32e0b2cf Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 29 Dec 2012 15:10:30 +0000 Subject: [PATCH] Made the third argument optional git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2386 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/Blocking.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FHEM/Blocking.pm b/FHEM/Blocking.pm index 8a2747344..112aff238 100644 --- a/FHEM/Blocking.pm +++ b/FHEM/Blocking.pm @@ -2,24 +2,22 @@ # $Id: $ package main; -use strict; -use warnings; -use IO::Socket::INET; - -sub BlockingCall($$$$); - - =pod ### Usage: sub TestBlocking() { BlockingCall("DoSleep", 5, "SleepDone", 8); } sub DoSleep($) { sleep(shift); return "I'm done"; } sub SleepDone($) { Log 1, "SleepDone: " . shift; } - =cut +use strict; +use warnings; +use IO::Socket::INET; + +sub BlockingCall($$@); + sub -BlockingCall($$$$) +BlockingCall($$@) { my ($blockingFn, $arg, $finishFn, $timeout) = @_; @@ -40,6 +38,8 @@ BlockingCall($$$$) my $ret = &{$blockingFn}($arg); use strict "refs"; + exit(0) if(!$finishFn); + # Look for the telnetport my $tp; foreach my $d (sort keys %defs) {