MSYS2-packages/msys2-runtime-3.4/0018-strace-quiet-be-really-quiet.patch
Christoph Reiter 14e5524bed Add msys2-runtime-3.4
This will be the msys2-runtime variant that still works on Win7.
2024-03-15 17:55:50 +01:00

38 lines
1.5 KiB
Diff

From 135fa9942180eb50a404ddb59b7131b827550b39 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 18/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 e7ec38e..f6186be 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: