summaryrefslogtreecommitdiff
path: root/t/helper/test-parse-options.c
diff options
context:
space:
mode:
authorLibravatar Josh Steadmon <steadmon@google.com>2021-11-18 14:01:41 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-11-18 22:38:15 -0800
commit538ac746048fab0ed32b972e34eaabb9fb3f15b9 (patch)
tree6f179087022b1e51fa3d140510a4c7809948eea6 /t/helper/test-parse-options.c
parentMerge branch 'vd/pthread-setspecific-g11-fix' into maint (diff)
downloadtgif-538ac746048fab0ed32b972e34eaabb9fb3f15b9.tar.xz
trace2: disable tr2_dst before warning on write errors
If writing a trace2 message fails, we optionally warn the user of this fact. However, in 0ee10fd (usage: add trace2 entry upon warning(), 2020-11-23), we added a trace entry to the warning() function. This means that we can enter an infinite loop of failing trace2 writes and warnings. Fix this by disabling the failing trace2 destination before issuing the warning. Additionally, trace2 sets a default SIGPIPE handler (tr2main_signal_handler) when it is initialized. This handler generates its own trace2 messages when a signal is received. If a trace2 write fails due to a broken pipe, this handler will run and then cause another failed write. Fix this by temporarily ignoring SIGPIPE while writing trace2 messages. This is safe because the write will still fail, and we will disable the failing destination. Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-parse-options.c')
0 files changed, 0 insertions, 0 deletions