38 lines
1.5 KiB
Diff
38 lines
1.5 KiB
Diff
From 16e335f3fd875d2481bcfbcaa56a7021381d4b72 Mon Sep 17 00:00:00 2001
|
|
From: Johannes Schindelin <johannes.schindelin@gmx.de>
|
|
Date: Wed, 17 May 2017 18:13:32 +0200
|
|
Subject: [PATCH 12/N] strace --quiet: be *really* quiet
|
|
|
|
The biggest problem with strace spitting out `create_child: ...` despite
|
|
being asked to be real quiet is that its output can very well interfere
|
|
with scripts' operations.
|
|
|
|
For example, when running any of Git for Windows' shell scripts with
|
|
`GIT_STRACE_COMMANDS=/path/to/logfile` (which is sadly an often needed
|
|
debugging technique while trying to address the many MSYS2 issues Git for
|
|
Windows faces), any time the output of any command is redirected into a
|
|
variable, it will include that `create_child: ...` line, wreaking havoc
|
|
with Git's expectations.
|
|
|
|
So let's just really be quiet when we're asked to be quiet.
|
|
|
|
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
|
---
|
|
winsup/utils/mingw/strace.cc | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/winsup/utils/mingw/strace.cc b/winsup/utils/mingw/strace.cc
|
|
index d346abc..a6b2e5d 100644
|
|
--- a/winsup/utils/mingw/strace.cc
|
|
+++ b/winsup/utils/mingw/strace.cc
|
|
@@ -352,7 +352,8 @@ create_child (char **argv)
|
|
flags |= CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP;
|
|
|
|
make_command_line (one_line, argv);
|
|
- printf ("create_child: %s\n", one_line.buf);
|
|
+ if (!quiet)
|
|
+ printf ("create_child: %s\n", one_line.buf);
|
|
|
|
SetConsoleCtrlHandler (NULL, 0);
|
|
/* Commit message for this code was:
|