From: Daniel Vrátil Date: Wed, 12 Sep 2018 15:05:31 +0000 (+0200) Subject: exec: fix potential deadlock after fork() X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=0684aea7453186e6f90ce4b6b8c5bcca68f0d1b9;hp=0684aea7453186e6f90ce4b6b8c5bcca68f0d1b9;p=collectd.git exec: fix potential deadlock after fork() POSIX forbids calling functions which are not thread-safe like setenv() after fork() in multi-threaded programs. It happens to work just fine with some libc implementations, but it causes a deadlock in the child process with uClibc for example. The proper way to pass new environment variables to the child process is to update parent's environment before the fork(), so that the child inherits the updated environment and then undo the changes in the parent process again. Signed-off-by: Florian Forster ---