diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-16 16:02:49 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-16 16:02:49 +0900 |
commit | 07b12a1f4829ca3c7d60d56bb5c89069f0758d4c (patch) | |
tree | eae3eda66d304d5604af1fd28086e9612224025f | |
parent | ee7bd7d7325d670c5bb204a63dc845465ca3f96a (diff) | |
download | ruby-07b12a1f4829ca3c7d60d56bb5c89069f0758d4c.tar.gz |
Suppress unused-variable warnings
-rw-r--r-- | process.c | 4 | ||||
-rw-r--r-- | thread_pthread.c | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -4088,10 +4088,10 @@ struct child_handler_disabler_state static void disable_child_handler_before_fork(struct child_handler_disabler_state *old) { +#ifdef HAVE_PTHREAD_SIGMASK int ret; sigset_t all; -#ifdef HAVE_PTHREAD_SIGMASK ret = sigfillset(&all); if (ret == -1) rb_sys_fail("sigfillset"); @@ -4108,9 +4108,9 @@ disable_child_handler_before_fork(struct child_handler_disabler_state *old) static void disable_child_handler_fork_parent(struct child_handler_disabler_state *old) { +#ifdef HAVE_PTHREAD_SIGMASK int ret; -#ifdef HAVE_PTHREAD_SIGMASK ret = pthread_sigmask(SIG_SETMASK, &old->sigmask, NULL); /* not async-signal-safe */ if (ret != 0) { rb_syserr_fail(ret, "pthread_sigmask"); diff --git a/thread_pthread.c b/thread_pthread.c index 36c0b33e00..15a5ff826b 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -765,10 +765,10 @@ get_stack(void **addr, size_t *size) # endif # ifdef HAVE_PTHREAD_ATTR_GETGUARDSIZE CHECK_ERR(pthread_attr_getguardsize(&attr, &guard)); - *size -= guard; # else - *size -= getpagesize(); + guard = getpagesize(); # endif + *size -= guard; pthread_attr_destroy(&attr); #elif defined HAVE_PTHREAD_ATTR_GET_NP /* FreeBSD, DragonFly BSD, NetBSD */ pthread_attr_t attr; |