aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/llfile.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/linden/indra/llcommon/llfile.cpp b/linden/indra/llcommon/llfile.cpp
index d551f28..32e9622 100644
--- a/linden/indra/llcommon/llfile.cpp
+++ b/linden/indra/llcommon/llfile.cpp
@@ -272,9 +272,11 @@ void llofstream::open(const char* _Filename, /* Flawfinder: ignore */
272 272
273void llofstream::close() 273void llofstream::close()
274{ // close the C stream 274{ // close the C stream
275 llassert(_Filebuffer); 275 if(is_open())
276 if (_Filebuffer->close() == 0) 276 {
277 _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/ 277 if (_Filebuffer->close() == 0)
278 _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/
279 }
278} 280}
279 281
280llofstream::llofstream(const char *_Filename, 282llofstream::llofstream(const char *_Filename,
@@ -286,7 +288,8 @@ llofstream::llofstream(const char *_Filename,
286} 288}
287 289
288llofstream::~llofstream() 290llofstream::~llofstream()
289{ // destroy the object 291{
292 // destroy the object
290 if (_ShouldClose) 293 if (_ShouldClose)
291 { 294 {
292 close(); 295 close();