Skip to content

Commit

Permalink
strace --quiet: be *really* quiet
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho committed Aug 27, 2024
1 parent 4f01c3f commit d43f1ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion winsup/utils/mingw/strace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d43f1ee

Please sign in to comment.