* #21631: yamlemitter: don't close invalid file descriptor

This commit is contained in:
Tristan Matthews
2013-03-14 18:02:19 -04:00
parent b99345b2fe
commit d9da61f5e3

View File

@ -76,8 +76,10 @@ void YamlEmitter::close()
// Refererence:
// http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.9
if (!fd_)
if (!fd_) {
ERROR("File descriptor not valid");
return;
}
if (fclose(fd_))
ERROR("Error closing file descriptor");