[Libreoffice-commits] core.git: sal/osl
Stephan Bergmann
sbergman at redhat.com
Tue Oct 6 02:52:29 PDT 2015
sal/osl/unx/file.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 78697c7956abdb610c256ba9d445a44c6d113d99
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 6 11:51:19 2015 +0200
pthread_mutex_lock/unlock must not be called with null argument
...so these OSL_PRECOND should really be assert
Change-Id: I61ebd16e14be81c579cd71f3cd6cd68afb95778d
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 09c5047..62cb129 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -38,6 +38,7 @@
#include "uunxapi.hxx"
#include <algorithm>
+#include <cassert>
#include <limits>
#include <string.h>
@@ -217,12 +218,12 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
FileHandle_Impl::Guard::Guard(pthread_mutex_t * pMutex)
: m_mutex (pMutex)
{
- OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer.");
+ assert(m_mutex != 0);
(void) pthread_mutex_lock (m_mutex); // ignoring EINVAL ...
}
FileHandle_Impl::Guard::~Guard()
{
- OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer.");
+ assert(m_mutex != 0);
(void) pthread_mutex_unlock (m_mutex);
}
More information about the Libreoffice-commits
mailing list