]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc_monitord: make lxc-monitord async signal safe 1327/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 27 Nov 2016 00:43:37 +0000 (01:43 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 27 Nov 2016 03:28:01 +0000 (04:28 +0100)
commitd0dacf05a66b8f791650855673782649ee36a4a7
tree7053b00f2bc1d28847c90ab2e31e6fd7ddfa4125
parent8d58eea994be73f97e7e739fc13164aa694ed94d
lxc_monitord: make lxc-monitord async signal safe

Before lxc_monitord called lxc_monitord_cleanup() from a signal handler.  This
function calls a bunch of async signal unsafe functions and basically begs for
deadlocks. This commit switches lxc-monitord to using sigsetjmp() and
siglongjmp() in the signal handler to jump to a cleanup label that call
lxc_monitord_cleanup(). In this way, we avoid using async signal unsafe
functions.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxc_monitord.c