summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2011-04-23 07:38:27 -0700
committerMichael Meeks <michael.meeks@novell.com>2011-04-26 15:13:59 +0100
commit567bfd0e92fe3d1b0d899974c913a1f8b1b48cbc (patch)
treefdb2973d122fe415a02761b50d98797057401562 /sal
parent44f720b12b685ce942e53866ae452c6c00b8b18c (diff)
Switched a write to safeWrite in profile.c.
Cleaned up some code related to a now unneeded assertion.
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/profile.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c
index c2a0cc490af9..de8af04775a1 100644
--- a/sal/osl/unx/profile.c
+++ b/sal/osl/unx/profile.c
@@ -437,7 +437,6 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
static sal_Bool writeProfileImpl(osl_TFile* pFile)
{
- int BytesWritten=0;
#if OSL_DEBUG_LEVEL > 1
unsigned int nLen=0;
#endif
@@ -459,19 +458,12 @@ static sal_Bool writeProfileImpl(osl_TFile* pFile)
OSL_ASSERT(nLen == (pFile->m_nWriteBufLen - pFile->m_nWriteBufFree));
#endif
- BytesWritten = write(pFile->m_Handle, pFile->m_pWriteBuf, pFile->m_nWriteBufLen - pFile->m_nWriteBufFree);
-
- if ( BytesWritten <= 0 )
+ if ( !safeWrite(pFile->m_Handle, pFile->m_pWriteBuf, pFile->m_nWriteBufLen - pFile->m_nWriteBufFree) )
{
OSL_TRACE("write failed '%s'\n",strerror(errno));
return (sal_False);
}
-#if OSL_DEBUG_LEVEL > 1
- OSL_ASSERT(
- BytesWritten >= 0 && SAL_INT_CAST(unsigned int, BytesWritten) == nLen);
-#endif
-
free(pFile->m_pWriteBuf);
pFile->m_pWriteBuf=0;
pFile->m_nWriteBufLen=0;