testbot/lib: If we cannot open the log file, then log to stderr.
Christian Costa
titan.costa at gmail.com
Mon Oct 15 08:54:19 CDT 2012
Hi François,
While your are at it. I would like to do a suggestion.
Indeed that would be great to be able to download some files along with the
test.
Typically for me avi files and dlls (or .drv) would be great ! :D
Thanks
Christian,
2012/10/15 Francois Gouget <fgouget at codeweavers.com>
> ---
> testbot/lib/WineTestBot/Log.pm | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/testbot/lib/WineTestBot/Log.pm
> b/testbot/lib/WineTestBot/Log.pm
> index 6883968..7de6dcb 100644
> --- a/testbot/lib/WineTestBot/Log.pm
> +++ b/testbot/lib/WineTestBot/Log.pm
> @@ -38,20 +38,18 @@ sub LogMsg(@)
> if (!defined $logfile)
> {
> my $oldumask = umask(002);
> - if (open($logfile, ">>", "$LogDir/log"))
> - {
> - # Flush after each print
> - my $tmp=select($logfile);
> - $| = 1;
> - select($tmp);
> - }
> - else
> + if (!open($logfile, ">>", "$LogDir/log"))
> {
> require File::Basename;
> print STDERR File::Basename::basename($0), ":warning: could not
> open '$LogDir/log' for writing: $!\n";
> - $logfile = undef;
> + open($logfile, ">>&=", 2);
> }
> umask($oldumask);
> +
> + # Flush after each print
> + my $tmp=select($logfile);
> + $| = 1;
> + select($tmp);
> }
> print $logfile scalar localtime, " ", @_ if ($logfile);
> }
> --
> 1.7.10.4
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20121015/20b3fa66/attachment.html>
More information about the wine-devel
mailing list