* Set up the thread signal mask, we don't want to run our signal handlers * in downloading and uploading threads. */
| 85 | * in downloading and uploading threads. |
| 86 | */ |
| 87 | void MaskThreadSignals() { |
| 88 | sigset_t sigs; |
| 89 | |
| 90 | if (pthread_equal(main_tid, pthread_self())) { |
| 91 | S3ERROR("thread_mask is called from main thread!"); |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | sigemptyset(&sigs); |
| 96 | |
| 97 | /* make our thread to ignore these signals (which should allow that they be |
| 98 | * delivered to the main thread) */ |
| 99 | sigaddset(&sigs, SIGHUP); |
| 100 | sigaddset(&sigs, SIGINT); |
| 101 | sigaddset(&sigs, SIGTERM); |
| 102 | sigaddset(&sigs, SIGALRM); |
| 103 | sigaddset(&sigs, SIGUSR1); |
| 104 | sigaddset(&sigs, SIGUSR2); |
| 105 | |
| 106 | pthread_sigmask(SIG_BLOCK, &sigs, NULL); |
| 107 | } |
| 108 | |
| 109 | /* |
| 110 | * Detect data format |
no test coverage detected