summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 14:51:53 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 14:51:53 (GMT)
commitceab2821a0c9e933ec37a228edf3f9ed113da15e (patch)
treeaa0b7744d67decef8658d5f239fbbe5636d1df8c /mjit_worker.c
parentcdffad515c1bc321c4ac7cf864d57b5a50cf4b6f (diff)
mjit_worker.c: don't suppress cl.exe logs
on --jit-verbose=2+. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index c66d90f..184a4a9 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -734,20 +734,24 @@ compile_c_to_so(const char *c_file, const char *so_file)
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);