зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
3f6a4be3a4
Коммит
c8cfd78b40
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче