Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put rb_fork back into process.c #7834

Merged
merged 1 commit into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13661,7 +13661,6 @@ ruby.$(OBJEXT): $(top_srcdir)/internal/loadpath.h
ruby.$(OBJEXT): $(top_srcdir)/internal/missing.h
ruby.$(OBJEXT): $(top_srcdir)/internal/object.h
ruby.$(OBJEXT): $(top_srcdir)/internal/parse.h
ruby.$(OBJEXT): $(top_srcdir)/internal/process.h
ruby.$(OBJEXT): $(top_srcdir)/internal/serial.h
ruby.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
ruby.$(OBJEXT): $(top_srcdir)/internal/string.h
Expand Down
14 changes: 0 additions & 14 deletions internal/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "ruby/ruby.h" /* for VALUE */
#include "internal/compilers.h" /* for __has_warning */
#include "internal/imemo.h" /* for RB_IMEMO_TMPBUF_PTR */
#include "internal/warnings.h" /* for COMPILER_WARNING_PUSH */

#define RB_MAX_GROUPS (65536)

Expand Down Expand Up @@ -122,17 +121,4 @@ ARGVSTR2ARGC(VALUE argv_str)
return i - 1;
}

#ifdef HAVE_WORKING_FORK
COMPILER_WARNING_PUSH
#if __has_warning("-Wdeprecated-declarations") || RBIMPL_COMPILER_IS(GCC)
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
#endif
static inline rb_pid_t
rb_fork(void)
{
return fork();
}
COMPILER_WARNING_POP
#endif

#endif /* INTERNAL_PROCESS_H */
11 changes: 11 additions & 0 deletions process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,17 @@ after_fork_ruby(rb_pid_t pid)

#if defined(HAVE_WORKING_FORK)

COMPILER_WARNING_PUSH
#if __has_warning("-Wdeprecated-declarations") || RBIMPL_COMPILER_IS(GCC)
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
#endif
static inline rb_pid_t
rb_fork(void)
{
return fork();
}
COMPILER_WARNING_POP

/* try_with_sh and exec_with_sh should be async-signal-safe. Actually it is.*/
#define try_with_sh(err, prog, argv, envp) ((err == ENOEXEC) ? exec_with_sh((prog), (argv), (envp)) : (void)0)
static void
Expand Down
1 change: 0 additions & 1 deletion ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "internal/missing.h"
#include "internal/object.h"
#include "internal/parse.h"
#include "internal/process.h"
#include "internal/variable.h"
#include "ruby/encoding.h"
#include "ruby/thread.h"
Expand Down