aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/signal.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/signal.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/signal.c b/src/signal.c
index fc4ac8b..a0b9c3d 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -8,16 +8,19 @@ volatile sig_atomic_t global_stop_flag = 0;
int signal_set_thread_attr(pthread_attr_t *attr)
{
+ int ret = 0;
+
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGQUIT);
sigaddset(&set, SIGTERM);
- if (pthread_attr_setsigmask_np(attr, &set)) {
- print_errno("pthread_attr_setsigmask_np");
- return -1;
+ ret = pthread_attr_setsigmask_np(attr, &set);
+ if (ret) {
+ pthread_print_errno(ret, "pthread_attr_setsigmask_np");
+ return ret;
}
- return 0;
+ return ret;
}