]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove unneeded parameter 'first_time' from possibly_become_daemon()
authorSteffan Karger <steffan@karger.me>
Thu, 26 Mar 2015 00:01:29 +0000 (01:01 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 13 Apr 2015 19:14:32 +0000 (21:14 +0200)
The static helper function possibly_become_daemon() is called only once,
by do_init_first_time(), which checks 'first_time' to be true before
calling possibly_become_daemon().  This makes the parameter useless.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1427328089-886-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9555
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c

index b670a48fc91d325744b0b72b2aa6f43c575aa7a7..b97d2da76a1c5eab10416a732aa978d9e0490adc 100644 (file)
@@ -917,10 +917,10 @@ do_persist_tuntap (const struct options *options)
  * Return true if we did it.
  */
 static bool
-possibly_become_daemon (const struct options *options, const bool first_time)
+possibly_become_daemon (const struct options *options)
 {
   bool ret = false;
-  if (first_time && options->daemon)
+  if (options->daemon)
     {
       ASSERT (!options->inetd);
       if (daemon (options->cd_dir != NULL, options->log) < 0)
@@ -2771,7 +2771,7 @@ do_init_first_time (struct context *c)
       get_pid_file (c->options.writepid, &c0->pid_state);
 
       /* become a daemon if --daemon */
-      c->did_we_daemonize = possibly_become_daemon (&c->options, c->first_time);
+      c->did_we_daemonize = possibly_become_daemon (&c->options);
 
       /* should we disable paging? */
       if (c->options.mlock && c->did_we_daemonize)