1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* process.c (proc_exec_cmd) renamed from proc_exec_v.

(proc_exec_sh): renamed from rb_proc_exec_e.
  (proc_spawn_cmd_internal): renamed from proc_spawn_v.
  (proc_spawn_cmd): renamed from proc_spawn_n.
  (proc_spawn_sh): renamed from proc_spawn.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-06-06 12:33:28 +00:00
parent ee011f7b1f
commit 3c3b563205
2 changed files with 21 additions and 13 deletions

View file

@ -1,3 +1,11 @@
Wed Jun 6 21:31:21 2012 Tanaka Akira <akr@fsij.org>
* process.c (proc_exec_cmd) renamed from proc_exec_v.
(proc_exec_sh): renamed from rb_proc_exec_e.
(proc_spawn_cmd_internal): renamed from proc_spawn_v.
(proc_spawn_cmd): renamed from proc_spawn_n.
(proc_spawn_sh): renamed from proc_spawn.
Wed Jun 6 21:18:47 2012 NAKAMURA Usaku <usa@ruby-lang.org> Wed Jun 6 21:18:47 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* process.c (try_with_sh): please take care of the macro defined by * process.c (try_with_sh): please take care of the macro defined by

View file

@ -1070,7 +1070,7 @@ exec_with_sh(const char *prog, char **argv, char **envp)
/* This function should be async-signal-safe. Actually it isn't because after_exec(). */ /* This function should be async-signal-safe. Actually it isn't because after_exec(). */
static int static int
proc_exec_v(const char *prog, VALUE argv_str, VALUE envp_str) proc_exec_cmd(const char *prog, VALUE argv_str, VALUE envp_str)
{ {
#ifdef __native_client__ #ifdef __native_client__
rb_notimplement(); rb_notimplement();
@ -1137,7 +1137,7 @@ proc_exec_v(const char *prog, VALUE argv_str, VALUE envp_str)
/* This function should be async-signal-safe. Actually it isn't because after_exec(). */ /* This function should be async-signal-safe. Actually it isn't because after_exec(). */
static int static int
rb_proc_exec_e(const char *str, VALUE envp_str) proc_exec_sh(const char *str, VALUE envp_str)
{ {
#ifdef __native_client__ #ifdef __native_client__
rb_notimplement(); rb_notimplement();
@ -1187,7 +1187,7 @@ rb_proc_exec_e(const char *str, VALUE envp_str)
int int
rb_proc_exec(const char *str) rb_proc_exec(const char *str)
{ {
return rb_proc_exec_e(str, Qfalse); return proc_exec_sh(str, Qfalse);
} }
enum { enum {
@ -1220,10 +1220,10 @@ enum {
#if USE_SPAWNV #if USE_SPAWNV
#if defined(_WIN32) #if defined(_WIN32)
#define proc_spawn_v(argv, prog) rb_w32_aspawn(P_NOWAIT, (prog), (argv)) #define proc_spawn_cmd_internal(argv, prog) rb_w32_aspawn(P_NOWAIT, (prog), (argv))
#else #else
static rb_pid_t static rb_pid_t
proc_spawn_v(char **argv, char *prog) proc_spawn_cmd_internal(char **argv, char *prog)
{ {
char fbuf[MAXPATHLEN]; char fbuf[MAXPATHLEN];
rb_pid_t status; rb_pid_t status;
@ -1250,7 +1250,7 @@ proc_spawn_v(char **argv, char *prog)
#endif #endif
static rb_pid_t static rb_pid_t
proc_spawn_n(char **argv, VALUE prog, VALUE options) proc_spawn_cmd(char **argv, VALUE prog, VALUE options)
{ {
rb_pid_t pid = -1; rb_pid_t pid = -1;
@ -1262,17 +1262,17 @@ proc_spawn_n(char **argv, VALUE prog, VALUE options)
} }
pid = rb_w32_aspawn_flags(P_NOWAIT, prog ? RSTRING_PTR(prog) : 0, argv, flags); pid = rb_w32_aspawn_flags(P_NOWAIT, prog ? RSTRING_PTR(prog) : 0, argv, flags);
#else #else
pid = proc_spawn_v(argv, prog ? RSTRING_PTR(prog) : 0); pid = proc_spawn_cmd_internal(argv, prog ? RSTRING_PTR(prog) : 0);
#endif #endif
} }
return pid; return pid;
} }
#if defined(_WIN32) #if defined(_WIN32)
#define proc_spawn(str) rb_w32_spawn(P_NOWAIT, (str), 0) #define proc_spawn_sh(str) rb_w32_spawn(P_NOWAIT, (str), 0)
#else #else
static rb_pid_t static rb_pid_t
proc_spawn(char *str) proc_spawn_sh(char *str)
{ {
char fbuf[MAXPATHLEN]; char fbuf[MAXPATHLEN];
rb_pid_t status; rb_pid_t status;
@ -2608,13 +2608,13 @@ rb_exec_err(const struct rb_exec_arg *e, char *errmsg, size_t errmsg_buflen)
} }
if (e->use_shell) { if (e->use_shell) {
rb_proc_exec_e(RSTRING_PTR(e->invoke.sh.shell_script), e->envp_str); /* not async-signal-safe because after_exec. */ proc_exec_sh(RSTRING_PTR(e->invoke.sh.shell_script), e->envp_str); /* not async-signal-safe because after_exec. */
} }
else { else {
char *abspath = NULL; char *abspath = NULL;
if (!NIL_P(e->invoke.cmd.command_abspath)) if (!NIL_P(e->invoke.cmd.command_abspath))
abspath = RSTRING_PTR(e->invoke.cmd.command_abspath); abspath = RSTRING_PTR(e->invoke.cmd.command_abspath);
proc_exec_v(abspath, e->invoke.cmd.argv_str, e->envp_str); /* async-signal-safe */ proc_exec_cmd(abspath, e->invoke.cmd.argv_str, e->envp_str); /* async-signal-safe */
} }
#if !defined(HAVE_FORK) #if !defined(HAVE_FORK)
preserving_errno(rb_run_exec_options_err(sargp, NULL, errmsg, errmsg_buflen)); preserving_errno(rb_run_exec_options_err(sargp, NULL, errmsg, errmsg_buflen));
@ -3176,11 +3176,11 @@ rb_spawn_process(struct rb_exec_arg *earg, char *errmsg, size_t errmsg_buflen)
} }
# if defined HAVE_SPAWNV # if defined HAVE_SPAWNV
if (earg->use_shell) { if (earg->use_shell) {
pid = proc_spawn(RSTRING_PTR(prog)); /* xxx: earg is ignored. */ pid = proc_spawn_sh(RSTRING_PTR(prog)); /* xxx: earg is ignored. */
} }
else { else {
char **argv = ARGVSTR2ARGV(earg->invoke.cmd.argv_str); char **argv = ARGVSTR2ARGV(earg->invoke.cmd.argv_str);
pid = proc_spawn_n(argv, prog, earg->options); /* xxx: earg (except options) is ignored. */ pid = proc_spawn_cmd(argv, prog, earg->options); /* xxx: earg (except options) is ignored. */
} }
# if defined(_WIN32) # if defined(_WIN32)
if (pid == -1) if (pid == -1)