summaryrefslogtreecommitdiffstats
path: root/src/input/pvsPrivInputHandler.cpp
diff options
context:
space:
mode:
authorSebastien Braun2010-10-11 12:27:27 +0200
committerSebastien Braun2010-10-11 12:27:27 +0200
commitbcaa6e3580f5b227ab48693192c459cc72c30224 (patch)
treebe40c6908e375a0d31cbb77a9b82f6b39a728063 /src/input/pvsPrivInputHandler.cpp
parentLog unmatched events in pvsprivinputd, too. (diff)
downloadpvs-bcaa6e3580f5b227ab48693192c459cc72c30224.tar.gz
pvs-bcaa6e3580f5b227ab48693192c459cc72c30224.tar.xz
pvs-bcaa6e3580f5b227ab48693192c459cc72c30224.zip
Better error handling for PVSPrivInputHandler
Diffstat (limited to 'src/input/pvsPrivInputHandler.cpp')
-rw-r--r--src/input/pvsPrivInputHandler.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/input/pvsPrivInputHandler.cpp b/src/input/pvsPrivInputHandler.cpp
index 84ccbae..d33697a 100644
--- a/src/input/pvsPrivInputHandler.cpp
+++ b/src/input/pvsPrivInputHandler.cpp
@@ -86,9 +86,24 @@ void PVSPrivInputHandler::canRead()
if(!pvsPrivInputRecvMessage(_fd, _messageAssembly.data(), siz, pid, uid, gid, &err))
{
- close(_fd);
- deleteLater();
- return;
+ switch(err)
+ {
+ case EAGAIN:
+#if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN)
+ case EWOULDBLOCK:
+#endif
+ // That's okay. Nothing to do.
+ break;
+ case 0:
+ // We'll survive. There was no actual error, just the library routine
+ // that decided it did not really want to receive that packet.
+ break;
+ default:
+ qWarning("Something bad just happened, and cannot handle it. Panicking.");
+ close(_fd);
+ deleteLater();
+ return;
+ }
}
else
{