Moved signal(SIGPIPE, SIG_IGN) to main.

This commit is contained in:
Andreas 2013-01-28 14:39:31 +01:00
parent a40aa6fb8d
commit fcc0da554b
2 changed files with 9 additions and 2 deletions

View File

@ -406,6 +406,12 @@ int main(int argc, char *argv[]) {
qtsparkle::LoadTranslations(language);
#endif
#ifndef Q_OS_WIN32
// This is needed to prevent SIGPIPE Errors, which occur under some
// circumstances in RemoteClient. They cause a program termination.
signal(SIGPIPE, SIG_IGN);
#endif
// Icons
IconLoader::Init();

View File

@ -36,12 +36,13 @@ RemoteClient::RemoteClient(Application* app, QTcpSocket* client)
// Connect to the slot IncomingData when receiving data
connect(client, SIGNAL(readyRead()), this, SLOT(IncomingData()));
// Connect the signals to see if an error occured or the client
// was disconnected.
connect(client, SIGNAL(disconnected()), this, SLOT(Disconnected()));
connect(client, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(Error(QAbstractSocket::SocketError)));
signal(SIGPIPE, SIG_IGN);
// Check if we use auth code
QSettings s;