Fix: fd tracker: provide async-signal-safety for close wrapper
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Oct 2019 19:04:13 +0000 (15:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 7 Oct 2019 16:02:45 +0000 (12:02 -0400)
commit5932ab6faf3406b53687d54bf2804bbecb9ed7b4
tree6f8576bbf8dede27088caee7784d5a70bbda8d56
parentc97a0b6b701de5879f912b4d3ce260ae0d5f0bfc
Fix: fd tracker: provide async-signal-safety for close wrapper

close(3) is part of the async-signal-safe functions. Therefore, it is
expected that the close wrapper provided by liblttng-ust-fd-tracker
behaves in a async-signal-safe way.

Use a similar strategy as ust_lock() does: disable signals when taking
and releasing the lock, and keep track of nesting with a TLS variable.
This ensures signals are restored to their original state when close(3)
ends up being invoked.

Fixes: #1199
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-comm/lttng-ust-fd-tracker.c
This page took 0.025979 seconds and 4 git commands to generate.