mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:31:41 +03:00
runtests: show error message if file can't be written
This commit is contained in:
parent
58e85d6d1d
commit
4ced75b7ce
1 changed files with 10 additions and 7 deletions
|
|
@ -3997,14 +3997,17 @@ sub singletest_prepare {
|
|||
mkdir $d; # 0777
|
||||
}
|
||||
}
|
||||
open(my $outfile, ">", "$filename");
|
||||
binmode $outfile; # for crapage systems, use binary
|
||||
if($fileattr{'nonewline'}) {
|
||||
# cut off the final newline
|
||||
chomp($fileContent);
|
||||
if (open(my $outfile, ">", "$filename")) {
|
||||
binmode $outfile; # for crapage systems, use binary
|
||||
if($fileattr{'nonewline'}) {
|
||||
# cut off the final newline
|
||||
chomp($fileContent);
|
||||
}
|
||||
print $outfile $fileContent;
|
||||
close($outfile);
|
||||
} else {
|
||||
logmsg "ERROR: cannot write $filename\n";
|
||||
}
|
||||
print $outfile $fileContent;
|
||||
close($outfile);
|
||||
}
|
||||
}
|
||||
return ($why, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue