aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-08 16:50:23 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-08 16:50:23 -0400
commit4f300d547d65e50ac1fd635f8b22714c1544ba33 (patch)
treed37ced4a97dc2ac8b25f8dbf0594baded3ebb1d0 /src/app
parentf83b417bf819ef0cc5f6ff31dd683a53cd7f90f2 (diff)
downloadtor-4f300d547d65e50ac1fd635f8b22714c1544ba33.tar.gz
tor-4f300d547d65e50ac1fd635f8b22714c1544ba33.zip
When RunAsDaemon is set, crypto_postfork() as needed
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 1b1889779d..eb935fd4ee 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -81,6 +81,7 @@
#include "core/mainloop/cpuworker.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_util.h"
+#include "lib/crypt_ops/crypto_init.h"
#include "feature/dircache/dirserv.h"
#include "feature/relay/dns.h"
#include "core/or/dos.h"
@@ -2026,7 +2027,9 @@ options_act(const or_options_t *old_options)
/* Finish backgrounding the process */
if (options->RunAsDaemon) {
/* We may be calling this for the n'th time (on SIGHUP), but it's safe. */
- finish_daemon(options->DataDirectory);
+ int forked = finish_daemon(options->DataDirectory);
+ if (forked)
+ crypto_postfork();
}
/* See whether we need to enable/disable our once-a-second timer. */