Fix #7534 both v2 and v3 - copy_file failing to close file after stat error

[SVN r73402]
This commit is contained in:
Beman Dawes
2011-07-27 18:39:29 +00:00
parent 1774d737a0
commit 03fac52dcb
2 changed files with 8 additions and 2 deletions

View File

@@ -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 )

View File

@@ -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)