summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-14 08:33:12 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-14 08:33:12 +1100
commitd9c20d142539b53b052937274efd2e576d0712ec (patch)
treeeea319d20956509222aaf62977cdeede18e9f29b /vcl/workben
parenta5bc28e073c2dd1eb8ad733687dc827e6bac31bd (diff)
vcl: (workbench) check error status of socket writes
Change-Id: I0825a4e1a0dc49d7ab2d74ad4b11cfb8baf973f7
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/svpclient.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 1d25daf649a0..65d16c11e0fe 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -44,6 +44,7 @@
#include <math.h>
#include <errno.h>
+#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -214,8 +215,22 @@ OString MyWin::processCommand( const OString& rCommand )
else
{
ssize_t nBytes = 0;
- write( nSocket, rCommand.getStr(), rCommand.getLength() );
- write( nSocket, "\n", 1 );
+ ssize_t fd = 0;
+ fd = write( nSocket, rCommand.getStr(), rCommand.getLength() );
+
+ if (fd == 0)
+ SAL_WARN("vcl", "Connection closed on other end");
+ else if (fd < 0)
+ SAL_WARN("vcl", "Error writing to socket: " << strerror( errno ));
+
+ fd = write( nSocket, "\n", 1 );
+
+ if (fd == 0)
+ SAL_WARN("vcl", "Connection closed on other end");
+ else if (fd < 0)
+ SAL_WARN("vcl", "Error writing to socket: " << strerror( errno ));
+
+
char buf[256];
do
{