1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

changed the logging to work when the logfile is removed during testing

This commit is contained in:
Daniel Stenberg 2004-04-19 15:20:30 +00:00
parent 5506f8767c
commit 6f8b4395ec

View File

@ -38,15 +38,15 @@ use strict;
require "getpart.pm"; require "getpart.pm";
open(FTPLOG, ">log/ftpd.log") || # open and close each time to allow removal at any time
print STDERR "failed to open log file, runs without logging\n";
sub logmsg { sub logmsg {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time); localtime(time);
open(FTPLOG, ">>log/ftpd.log");
printf FTPLOG ("%02d:%02d:%02d (%d) ", printf FTPLOG ("%02d:%02d:%02d (%d) ",
$hour, $min, $sec, $$); $hour, $min, $sec, $$);
print FTPLOG @_; print FTPLOG @_;
close(FTPLOG);
} }
sub ftpmsg { sub ftpmsg {
@ -530,7 +530,6 @@ for ( $waitedpid = 0;
open(STDIN, "<&Client") || die "can't dup client to stdin"; open(STDIN, "<&Client") || die "can't dup client to stdin";
open(STDOUT, ">&Client") || die "can't dup client to stdout"; open(STDOUT, ">&Client") || die "can't dup client to stdout";
FTPLOG->autoflush(1);
&customize(); # read test control instructions &customize(); # read test control instructions
print @welcome; print @welcome;