From 96edebf4d9ec656ec6ed83dca3bbc3947033c71d Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 23 Apr 2008 23:55:34 +0000 Subject: improve synchronization between test harness runtests.pl script and test harness servers to minimize risk of false test failures. http://curl.haxx.se/mail/lib-2008-04/0392.html --- tests/ftp.pm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'tests/ftp.pm') diff --git a/tests/ftp.pm b/tests/ftp.pm index b3cc14abb..421fee1a6 100644 --- a/tests/ftp.pm +++ b/tests/ftp.pm @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -84,4 +84,25 @@ sub ftpkillslaves { } } + +sub set_advisor_read_lock { + my ($filename) = @_; + + if(open(FILEH, ">$filename")) { + close(FILEH); + return; + } + printf "Error creating lock file $filename error: $!"; +} + + +sub clear_advisor_read_lock { + my ($filename) = @_; + + if(-f $filename) { + unlink($filename); + } +} + + 1; -- cgit v1.2.1