From kde-commits Thu Aug 19 19:31:36 2004 From: John Tapsell Date: Thu, 19 Aug 2004 19:31:36 +0000 To: kde-commits Subject: kdeextragear-2/konversation/konversation Message-Id: <20040819193136.5E8AA90C5 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109294390501155 CVS commit by johnflux: Check the value of 'read' and show the user an error if it fails. M +6 -1 server.cpp 1.235 --- kdeextragear-2/konversation/konversation/server.cpp #1.234:1.235 @@ -15,4 +15,5 @@ #include #include +#include #ifdef __linux__ @@ -958,5 +959,9 @@ void Server::incoming() len = read(serverSocket.fd(),buffer,BUFFER_LEN-1); - + if(len==-1) { + statusView->appendServerMessage(i18n("Error"),i18n("There was an error reading the data from the server: %1").arg(strerror(errno))); + broken(0); + return; + } buffer[len] = 0;