Ignore exception if closing a closed file

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@38495 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-05-14 13:14:32 +00:00
parent 3a32e58eee
commit 865511899f

View file

@ -1410,7 +1410,10 @@ static NSString *noFiles = @"No log files to archive";
* Ensure that all data is written to file.
*/
fflush(stderr);
[hdl closeFile];
NS_DURING
[hdl closeFile];
NS_HANDLER
NS_HANDLER
/*
* If the file is empty, remove it, otherwise move to archive directory.
@ -1518,7 +1521,10 @@ static NSString *noFiles = @"No log files to archive";
if (desc != 2)
{
dup2(desc, 2);
[hdl closeFile];
NS_DURING
[hdl closeFile];
NS_HANDLER
NS_HANDLER
hdl = [NSFileHandle fileHandleWithStandardError];
}
}