mirror of
https://github.com/boostorg/filesystem.git
synced 2026-03-05 02:52:10 +00:00
Fix #7534 both v2 and v3 - copy_file failing to close file after stat error
[SVN r73402]
This commit is contained in:
@@ -1212,7 +1212,10 @@ namespace boost
|
||||
|
||||
struct stat from_stat;
|
||||
if ( ::stat( from_file_ph.c_str(), &from_stat ) != 0 )
|
||||
{ return error_code( errno, system_category() ); }
|
||||
{
|
||||
::close(infile);
|
||||
return error_code( errno, system_category() );
|
||||
}
|
||||
|
||||
int oflag = O_CREAT | O_WRONLY | O_TRUNC;
|
||||
if ( fail_if_exists )
|
||||
|
||||
@@ -431,7 +431,10 @@ namespace
|
||||
|
||||
struct stat from_stat;
|
||||
if (::stat(from_p.c_str(), &from_stat)!= 0)
|
||||
{ return false; }
|
||||
{
|
||||
::close(infile);
|
||||
return false;
|
||||
}
|
||||
|
||||
int oflag = O_CREAT | O_WRONLY | O_TRUNC;
|
||||
if (fail_if_exists)
|
||||
|
||||
Reference in New Issue
Block a user