summaryrefslogtreecommitdiffstats
path: root/io/source/acceptor
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-21 15:42:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 08:30:10 +0200
commitb63609ba5478ed9b020c113f5704f7ea8447dec8 (patch)
treee40896646675d8b462cec7a90ca1e94e902b3746 /io/source/acceptor
parentloplugin:flatten in filter..i18npool (diff)
downloadcore-b63609ba5478ed9b020c113f5704f7ea8447dec8.tar.gz
core-b63609ba5478ed9b020c113f5704f7ea8447dec8.zip
loplugin:flatten in framework..package
Change-Id: Ide8a97eae6e2fdc7d2dcccba1480ac55a9b555bc Reviewed-on: https://gerrit.libreoffice.org/42593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io/source/acceptor')
-rw-r--r--io/source/acceptor/acc_pipe.cxx37
1 files changed, 17 insertions, 20 deletions
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx
index b1395946d936..06570022aebc 100644
--- a/io/source/acceptor/acc_pipe.cxx
+++ b/io/source/acceptor/acc_pipe.cxx
@@ -70,35 +70,32 @@ namespace io_acceptor
sal_Int32 PipeConnection::read( Sequence < sal_Int8 > & aReadBytes , sal_Int32 nBytesToRead )
{
- if( ! m_nStatus )
+ if( m_nStatus )
{
- if( aReadBytes.getLength() < nBytesToRead )
- {
- aReadBytes.realloc( nBytesToRead );
- }
- sal_Int32 n = m_pipe.read( aReadBytes.getArray(), nBytesToRead );
- OSL_ASSERT( n >= 0 && n <= aReadBytes.getLength() );
- if( n < aReadBytes.getLength() )
- {
- aReadBytes.realloc( n );
- }
- return n;
- }
- else {
throw IOException();
}
+ if( aReadBytes.getLength() < nBytesToRead )
+ {
+ aReadBytes.realloc( nBytesToRead );
+ }
+ sal_Int32 n = m_pipe.read( aReadBytes.getArray(), nBytesToRead );
+ OSL_ASSERT( n >= 0 && n <= aReadBytes.getLength() );
+ if( n < aReadBytes.getLength() )
+ {
+ aReadBytes.realloc( n );
+ }
+ return n;
+
}
void PipeConnection::write( const Sequence < sal_Int8 > &seq )
{
- if( ! m_nStatus )
+ if( m_nStatus )
{
- if( m_pipe.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() )
- {
- throw IOException();
- }
+ throw IOException();
}
- else {
+ if( m_pipe.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() )
+ {
throw IOException();
}
}