X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/common/file.cpp diff --git a/src/common/file.cpp b/src/common/file.cpp index a6aa633b5a..7c494b4d71 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -213,11 +213,9 @@ bool wxFile::Create(const wxChar *szFileName, bool bOverwrite, int accessMode) wxLogSysError(_("can't create file '%s'"), szFileName); return false; } - else - { - Attach(fd); - return true; - } + + Attach(fd); + return true; } // open the file @@ -267,10 +265,9 @@ bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode) wxLogSysError(_("can't open file '%s'"), szFileName); return false; } - else { - Attach(fd); - return true; - } + + Attach(fd); + return true; } // close @@ -330,7 +327,7 @@ size_t wxFile::Write(const void *pBuf, size_t nCount) // flush bool wxFile::Flush() { -#if defined(__VISUALC__) || defined(HAVE_FSYNC) +#ifdef HAVE_FSYNC // fsync() only works on disk files and returns errors for pipes, don't // call it then if ( IsOpened() && GetKind() == wxFILE_KIND_DISK ) @@ -341,7 +338,7 @@ bool wxFile::Flush() return false; } } -#endif // fsync +#endif // HAVE_FSYNC return true; }