From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS shortcircuit=no autolearn=no autolearn_force=no version=3.4.1 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 584F11F62F; Mon, 25 Jun 2018 23:50:58 +0000 (UTC) From: Eric Wong To: spew@80x24.org Cc: Eric Wong Subject: [PATCH 4/8] cleanups Date: Mon, 25 Jun 2018 23:50:47 +0000 Message-Id: <20180625235051.66045-5-e@80x24.org> In-Reply-To: <20180625235051.66045-1-e@80x24.org> References: <20180625235051.66045-1-e@80x24.org> List-Id: --- mjit.c | 9 ++------- signal.c | 12 ------------ vm_core.h | 8 ++++++++ 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/mjit.c b/mjit.c index 659461cea6..a550d1aabd 100644 --- a/mjit.c +++ b/mjit.c @@ -119,7 +119,7 @@ extern void rb_native_cond_wait(rb_nativethread_cond_t *cond, rb_nativethread_lo extern int rb_thread_create_mjit_thread(void (*child_hook)(void), void (*worker_func)(void)); - +/* process.c */ pid_t ruby_waitpid_locked(rb_vm_t *, rb_pid_t, int *status, int options, rb_nativethread_cond_t *cond); @@ -137,7 +137,6 @@ pid_t ruby_waitpid_locked(rb_vm_t *, rb_pid_t, int *status, int options, #define WEXITSTATUS(S) (S) #define WIFSIGNALED(S) (0) typedef intptr_t pid_t; -#define USE_RUBY_WAITPID_LOCKED (0) #endif /* Atomically set function pointer if possible. */ @@ -151,10 +150,6 @@ typedef intptr_t pid_t; # define MJIT_ATOMIC_SET(var, val) ATOMIC_SET(var, val) #endif -#ifndef USE_RUBY_WAITPID_LOCKED /* platforms with real waitpid */ -# define USE_RUBY_WAITPID_LOCKED (1) -#endif /* USE_RUBY_WAITPID_LOCKED */ - /* A copy of MJIT portion of MRI options since MJIT initialization. We need them as MJIT threads still can work when the most MRI data were freed. */ @@ -413,7 +408,7 @@ exec_process(const char *path, char *const argv[]) { int stat, exit_code = -2; pid_t pid; - rb_vm_t *vm = USE_RUBY_WAITPID_LOCKED ? GET_VM() : 0; + rb_vm_t *vm = RUBY_SIGCHLD ? GET_VM() : 0; rb_nativethread_cond_t cond; if (vm) { diff --git a/signal.c b/signal.c index 22fc4286d9..b816403cb9 100644 --- a/signal.c +++ b/signal.c @@ -62,18 +62,6 @@ ruby_atomic_compare_and_swap(rb_atomic_t *ptr, rb_atomic_t cmp, } #endif -#ifndef NSIG -# define NSIG (_SIGMAX + 1) /* For QNX */ -#endif - -#if defined(SIGCLD) -# define RUBY_SIGCHLD (SIGCLD) -#elif defined(SIGCHLD) -# define RUBY_SIGCHLD (SIGCHLD) -#else -# define RUBY_SIGCHLD (0) -#endif - static const struct signals { const char *signm; int signo; diff --git a/vm_core.h b/vm_core.h index d0689e5ba6..936b22d439 100644 --- a/vm_core.h +++ b/vm_core.h @@ -92,6 +92,14 @@ #define RUBY_NSIG NSIG +#if defined(SIGCLD) +# define RUBY_SIGCHLD (SIGCLD) +#elif defined(SIGCHLD) +# define RUBY_SIGCHLD (SIGCHLD) +#else +# define RUBY_SIGCHLD (0) +#endif + #ifdef HAVE_STDARG_PROTOTYPES #include #define va_init_list(a,b) va_start((a),(b)) -- EW