diff options
author | Paul Wicking <paul.wicking@qt.io> | 2020-04-21 15:53:38 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-04-24 13:39:29 +0200 |
commit | 7cbe7f97ad7585c72b18f786b83122840f7159cc (patch) | |
tree | 6b603d5aa0abe0e3c6da04a1b80d4ec8b362ebf3 | |
parent | 7e6a846c447ba18526e0c6d0194fa4037174c45a (diff) | |
download | qtdoc-7cbe7f97ad7585c72b18f786b83122840f7159cc.tar.gz |
Doc: Fix snippet
The field sa_flags of the structure term is not initialized to zero, so
SA_RESTART is in OR with whatever value was in the memory. It should be
set to zero as already done for the structure hup.
Fixes: QTBUG-83686
Change-Id: If4c2b68136fb0cab26af164bbdb461807b11ce70
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
-rw-r--r-- | doc/src/snippets/code/doc_src_unix-signal-handlers.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/src/snippets/code/doc_src_unix-signal-handlers.cpp b/doc/src/snippets/code/doc_src_unix-signal-handlers.cpp index f2c2d198..a0073c5d 100644 --- a/doc/src/snippets/code/doc_src_unix-signal-handlers.cpp +++ b/doc/src/snippets/code/doc_src_unix-signal-handlers.cpp @@ -110,6 +110,7 @@ static int setup_unix_signal_handlers() term.sa_handler = MyDaemon::termSignalHandler; sigemptyset(&term.sa_mask); + term.sa_flags = 0; term.sa_flags |= SA_RESTART; if (sigaction(SIGTERM, &term, 0)) |