diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-08-08 17:32:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-08 17:32:26 -0400 |
commit | a57c27a1c749add88b088f570838373687a0c6fd (patch) | |
tree | bf14a87832ae51322b2c039b0c2174f4d67b7747 /src/app | |
parent | 622a2c6bee19af3bab0e84702a36ff2df39db7e7 (diff) | |
download | tor-a57c27a1c749add88b088f570838373687a0c6fd.tar.gz tor-a57c27a1c749add88b088f570838373687a0c6fd.zip |
Call crypto_postfork on start_daemon() instead.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index eb935fd4ee..d2ed295621 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -1411,7 +1411,8 @@ options_act_reversible(const or_options_t *old_options, char **msg) * processes. */ if (running_tor && options->RunAsDaemon) { /* No need to roll back, since you can't change the value. */ - start_daemon(); + if (start_daemon()) + crypto_postfork(); } #ifdef HAVE_SYSTEMD @@ -2027,9 +2028,7 @@ 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. */ - int forked = finish_daemon(options->DataDirectory); - if (forked) - crypto_postfork(); + finish_daemon(options->DataDirectory); } /* See whether we need to enable/disable our once-a-second timer. */ |