summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-07-26 13:48:28 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-07-27 05:17:49 +0000
commit97318a3d5fc3a2e9b97c7dd5a49ad0e09acbeaaa (patch)
tree97d23e69bd5963d767759133b1f0abcdb7840c49 /src/platformsupport
parentb694fe987cc423f5189102d25db1f7215a56b7f9 (diff)
embedded: Make signal handlers optional
[ChangeLog][Platform Specific Changes] It is now possible to opt out from installing signal handlers when running with eglfs and linuxfb by setting the QT_QPA_NO_SIGNAL_HANDLER environment variable to a non-zero value. Task-number: QTBUG-54733 Change-Id: Ib07d4bbf714c752631c49b76ad0a16677c1ba5bd Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index 5e062b3f0a..bfe6b28115 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -110,14 +110,16 @@ QFbVtHandler::QFbVtHandler(QObject *parent)
m_signalNotifier = new QSocketNotifier(m_sigFd[1], QSocketNotifier::Read, this);
connect(m_signalNotifier, &QSocketNotifier::activated, this, &QFbVtHandler::handleSignal);
- struct sigaction sa;
- sa.sa_flags = 0;
- sa.sa_handler = signalHandler;
- sigemptyset(&sa.sa_mask);
- sigaction(SIGINT, &sa, 0); // Ctrl+C
- sigaction(SIGTSTP, &sa, 0); // Ctrl+Z
- sigaction(SIGCONT, &sa, 0);
- sigaction(SIGTERM, &sa, 0); // default signal used by kill
+ if (!qEnvironmentVariableIntValue("QT_QPA_NO_SIGNAL_HANDLER")) {
+ struct sigaction sa;
+ sa.sa_flags = 0;
+ sa.sa_handler = signalHandler;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGINT, &sa, 0); // Ctrl+C
+ sigaction(SIGTSTP, &sa, 0); // Ctrl+Z
+ sigaction(SIGCONT, &sa, 0);
+ sigaction(SIGTERM, &sa, 0); // default signal used by kill
+ }
#endif
}