-rw-r--r-- | noncore/net/mail/opiemail.cpp | 14 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 5399c3c..2f87e44 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp @@ -18,11 +18,15 @@ /* QT */ +/* UNIX */ +#include <signal.h> + using namespace Opie::Core; OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) : MainWindow( parent, name, WStyle_ContextHelp ) { + setup_signalblocking(); settings = new Settings(); folderView->populate( settings->getAccounts() ); @@ -33,6 +37,16 @@ OpieMail::~OpieMail() if (settings) delete settings; } +void OpieMail::setup_signalblocking() +{ + /* for networking we must block SIGPIPE and Co. */ + struct sigaction blocking_action,temp_action; + blocking_action.sa_handler = SIG_IGN; + sigemptyset(&(blocking_action.sa_mask)); + blocking_action.sa_flags = 0; + sigaction(SIGPIPE,&blocking_action,&temp_action); +} + void OpieMail::appMessage(const QCString &msg, const QByteArray &data) { // copied from old mail2 diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h index b93bd60..3d25b3d 100644 --- a/noncore/net/mail/opiemail.h +++ b/noncore/net/mail/opiemail.h @@ -34,6 +34,9 @@ protected slots: virtual void slotMoveCopyMail(); virtual void reEditMail(); +protected: + void setup_signalblocking(); + private: Settings *settings; |