summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-07 08:04:39 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-07 08:04:39 +0000
commitc8cfd78b40d6d19fcacb7ca3a564de39907c4b59 (patch)
tree9a364aa02db6535dcb9e9271b5207484bc61176d /mjit_worker.c
parent3f6a4be3a40566b6cacdb20577a02eebaba8e90a (diff)
mjit_worker.c: stop expanding already-absolute MJIT_CC
r65577 seems to have made MJIT_CC (MJIT_CC_COMMONA) become an absolute path. So start_process doesn't need to find that from PATH by dln_find_exe_r. This commit is motivated by the msys2 AppVeyor CI failure: https://ci.appveyor.com/project/ruby/ruby/builds/20084104/job/1pg15os4dtttyl0q git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 6abd5f9dcb..19409ee00e 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -521,11 +521,10 @@ COMPILER_WARNING_PUSH
#ifdef __GNUC__
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
#endif
-/* Start an OS process of executable PATH with arguments ARGV. Return
- PID of the process.
- TODO: Use the same function in process.c */
+/* Start an OS process of absolute executable path with arguments ARGV.
+ Return PID of the process. */
static pid_t
-start_process(const char *path, char *const *argv)
+start_process(const char *abspath, char *const *argv)
{
pid_t pid;
/*
@@ -533,18 +532,12 @@ start_process(const char *path, char *const *argv)
* and execv for safety
*/
int dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
- char fbuf[MAXPATHLEN];
- const char *abspath = dln_find_exe_r(path, 0, fbuf, sizeof(fbuf));
- if (!abspath) {
- verbose(1, "MJIT: failed to find `%s' in PATH", path);
- return -1;
- }
if (mjit_opts.verbose >= 2) {
int i;
const char *arg;
- fprintf(stderr, "Starting process: %s", path);
+ fprintf(stderr, "Starting process: %s", abspath);
for (i = 0; (arg = argv[i]) != NULL; i++)
fprintf(stderr, " %s", arg);
fprintf(stderr, "\n");
@@ -567,7 +560,7 @@ start_process(const char *path, char *const *argv)
}
}
#else
- if ((pid = vfork()) == 0) {
+ if ((pid = vfork()) == 0) { /* TODO: reuse some function in process.c */
umask(0077);
if (mjit_opts.verbose == 0) {
/* CC can be started in a thread using a file which has been