aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-04-19 15:20:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-04-19 15:20:30 +0000
commit6f8b4395ec12484e4a461a999d1e52d669306a16 (patch)
tree32b9a2ffd512bb6cc0e81ba1f034a6de474421f8
parent5506f8767cddcdb81f5cd456c4a42dc90dcb1a50 (diff)
changed the logging to work when the logfile is removed during testing
-rw-r--r--tests/ftpserver.pl7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 3beb6030a..13c4b8218 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -38,15 +38,15 @@ use strict;
require "getpart.pm";
-open(FTPLOG, ">log/ftpd.log") ||
- print STDERR "failed to open log file, runs without logging\n";
-
+# open and close each time to allow removal at any time
sub logmsg {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
+ open(FTPLOG, ">>log/ftpd.log");
printf FTPLOG ("%02d:%02d:%02d (%d) ",
$hour, $min, $sec, $$);
print FTPLOG @_;
+ close(FTPLOG);
}
sub ftpmsg {
@@ -530,7 +530,6 @@ for ( $waitedpid = 0;
open(STDIN, "<&Client") || die "can't dup client to stdin";
open(STDOUT, ">&Client") || die "can't dup client to stdout";
- FTPLOG->autoflush(1);
&customize(); # read test control instructions
print @welcome;