]> git.proxmox.com Git - mirror_lxcfs.git/commit
fix two threading issues
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 20 May 2015 15:56:46 +0000 (08:56 -0700)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 20 May 2015 15:56:46 +0000 (08:56 -0700)
commit67bd113fe4a872fd83e9b98ed896ea77e1807dbf
tree8284a529d12f4e240d8daa1851a35f886949fc52
parent38a76a918f48f0c3f06f0c4d961a5bd1631ff05a
fix two threading issues

Make sure to prep dbus for threading before we start.

And use _exit() any time we are exiting from a forked child.  This is
to avoid calling the at_exit() functions.  Once a thread in the main
program has called nih_error_init(), this registers an at_exit fn which
asserts that the nih_context not be null - but after we fork, if libnih
is built with --enable-threading, then the nih_context is in fact null.
The only way to clear the atexit fns would be to exec().  So call
_exit() instead of exit(), because _exit() avoids calling the atexit
fns.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgmanager.c
lxcfs.c