[前][次][番号順一覧][スレッド一覧]

ruby-changes:53383

From: k0kubun <ko1@a...>
Date: Wed, 7 Nov 2018 17:04:43 +0900 (JST)
Subject: [ruby-changes:53383] k0kubun:r65599 (trunk): mjit_worker.c: stop expanding already-absolute MJIT_CC

k0kubun	2018-11-07 17:04:39 +0900 (Wed, 07 Nov 2018)

  New Revision: 65599

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65599

  Log:
    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

  Modified files:
    trunk/mjit_worker.c
Index: mjit_worker.c
===================================================================
--- mjit_worker.c	(revision 65598)
+++ mjit_worker.c	(revision 65599)
@@ -521,11 +521,10 @@ COMPILER_WARNING_PUSH https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L521
 #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 *co https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L532
      * 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 *co https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L560
         }
     }
 #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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]