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

ruby-changes:52732

From: k0kubun <ko1@a...>
Date: Sun, 7 Oct 2018 23:51:58 +0900 (JST)
Subject: [ruby-changes:52732] k0kubun:r64944 (trunk): mjit_worker.c: don't suppress cl.exe logs

k0kubun	2018-10-07 23:51:53 +0900 (Sun, 07 Oct 2018)

  New Revision: 64944

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

  Log:
    mjit_worker.c: don't suppress cl.exe logs
    
    on --jit-verbose=2+.

  Modified files:
    trunk/mjit_worker.c
Index: mjit_worker.c
===================================================================
--- mjit_worker.c	(revision 64943)
+++ mjit_worker.c	(revision 64944)
@@ -734,20 +734,24 @@ compile_c_to_so(const char *c_file, cons https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L734
         return FALSE;
 
     {
-        int stdout_fileno = _fileno(stdout);
-        int orig_fd = dup(stdout_fileno);
-        int dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
-
         /* Discard cl.exe's outputs like:
              _ruby_mjit_p12u3.c
-               Creating library C:.../_ruby_mjit_p12u3.lib and object C:.../_ruby_mjit_p12u3.exp
-           TODO: Don't discard them on --jit-verbose=2+ */
-        dup2(dev_null, stdout_fileno);
+               Creating library C:.../_ruby_mjit_p12u3.lib and object C:.../_ruby_mjit_p12u3.exp */
+        int stdout_fileno, orig_fd, dev_null;
+        if (mjit_opts.verbose <= 1) {
+            stdout_fileno = _fileno(stdout);
+            orig_fd = dup(stdout_fileno);
+            dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
+
+            dup2(dev_null, stdout_fileno);
+        }
         exit_code = exec_process(cc_path, args);
-        dup2(orig_fd, stdout_fileno);
+        if (mjit_opts.verbose <= 1) {
+            dup2(orig_fd, stdout_fileno);
 
-        close(orig_fd);
-        close(dev_null);
+            close(orig_fd);
+            close(dev_null);
+        }
     }
     free(args);
 

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

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