summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2009-09-28 09:24:05 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2009-09-28 09:35:01 (GMT)
commita49ca92bc343e58ec21dd52a933b23f43ecfc0a6 (patch)
treeefd425bdd2841c71aa150bc49272c9b616494873 /src/testlib
parent8f1f29432e274fcad2deae4ff19e2e738672b7cd (diff)
downloadQt-a49ca92bc343e58ec21dd52a933b23f43ecfc0a6.zip
Qt-a49ca92bc343e58ec21dd52a933b23f43ecfc0a6.tar.gz
Qt-a49ca92bc343e58ec21dd52a933b23f43ecfc0a6.tar.bz2
Make sure signal handlers are installed on QWS
QWS already installs message handlers, and this would cause testlib not to install its own handler, causing lots of extra test failures if there is a crash. The proper way would be to make testlib invoke previous handlers, but the quick and easy fix is just to forget about the old ones. The rationale is that the worst thing that can happen is that it will cause a crash, and that was going to happen anyway. Reviewed-by: Jeremy
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 3392ed7..7e7bcd1 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1517,10 +1517,14 @@ FatalSignalHandler::FatalSignalHandler()
for (int i = 0; fatalSignals[i]; ++i) {
sigaction(fatalSignals[i], &act, &oldact);
+#ifndef Q_WS_QWS
// Don't overwrite any non-default handlers
+ // however, we need to replace the default QWS handlers
if (oldact.sa_flags & SA_SIGINFO || oldact.sa_handler != SIG_DFL) {
sigaction(fatalSignals[i], &oldact, 0);
- } else {
+ } else
+#endif
+ {
sigaddset(&handledSignals, fatalSignals[i]);
}
}