diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2011-11-19 03:11:42 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2011-11-19 03:11:42 +0200 |
commit | 5e03999e937bc76f5020fa5b040bf403a5b37723 (patch) | |
tree | 8073d843c1fa28148f850d8b67bee2e0cb49bde8 /sal | |
parent | 552f521070bf5ff4e031206968463cd99061edc5 (diff) |
osl_syncFile() should work also for NULL handles
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 7a36e69fbdbf..b6b4600ae8b7 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -1082,12 +1082,12 @@ SAL_CALL osl_syncFile(oslFileHandle Handle) { FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle); + if ((0 == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (-1 == pImpl->m_fd))) + return osl_File_E_INVAL; + if (pImpl->m_kind == FileHandle_Impl::KIND_MEM) return osl_File_E_None; - if ((0 == pImpl) || (-1 == pImpl->m_fd)) - return osl_File_E_INVAL; - FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); OSL_TRACE("osl_syncFile(%d)", pImpl->m_fd); |