aboutsummaryrefslogtreecommitdiffstats
path: root/src/signal.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-15 17:06:36 +0000
committersaturneric <[email protected]>2024-01-15 17:08:48 +0000
commit5af14839b718896ed8049d52ab60601ea1291db9 (patch)
tree2be9bf07932f2fd21b9759c87036f8c47345ce75 /src/signal.cpp
parentrefactor: remove libicu from project (diff)
downloadGpgFrontend-5af14839b718896ed8049d52ab60601ea1291db9.tar.gz
GpgFrontend-5af14839b718896ed8049d52ab60601ea1291db9.zip
fix: remove low level api setjmp to improve corss-platform ability
Diffstat (limited to 'src/signal.cpp')
-rw-r--r--src/signal.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/signal.cpp b/src/signal.cpp
index 8c934166..7722c36f 100644
--- a/src/signal.cpp
+++ b/src/signal.cpp
@@ -26,41 +26,4 @@
*
*/
-#include <csetjmp>
-#include <iostream>
-
#include "GpgFrontend.h"
-
-#ifdef FREEBSD
-extern sigjmp_buf recover_env;
-#else
-extern jmp_buf recover_env;
-#endif
-
-/**
- * @brief handle the signal caught.
- *
- * @param sig signal number
- */
-void HandleSignal(int sig) {
- static int _repeat_handle_num = 1, last_sig = sig;
- // GF_MAIN_LOG_DEBUG("signal caught {}", sig);
- std::cout << "signal caught" << sig;
-
- if (last_sig == sig)
- _repeat_handle_num++;
- else
- _repeat_handle_num = 1, last_sig = sig;
-
- if (_repeat_handle_num > 3) {
- std::cout << "The same signal appears three times,"
- << "execute the termination operation." << sig;
- exit(-1);
- }
-
-#ifndef WINDOWS
- siglongjmp(recover_env, 1);
-#else
- longjmp(recover_env, 1);
-#endif
-}