Skip to contentSkip to conversation

Remove unneeded parameter 'first_time' from possibility_become_daemon()

PATCH In review Steffan Karger 2 participants 2 messages Mar 26, 2015 – Apr 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove unneeded parameter 'first_time' from possibility_become_daemon()

The static helper function possibily_become_deamon() is called only once, by do_init_first_time(), which checks 'first_time' to be true before calling possibily_become_daemon(). This makes the parameter useless.

---
 src/openvpn/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/openvpn/init.c +3 -3
index b670a48..b97d2da 100644
@@ -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)
Signature · 1 line
2.1.0
#1 lore raw

ACK.

Your patch has been applied to the master and release/2.3 branches.

commit 857c04ef06cd13d59c5b45332f07996e71372576 (master) commit c7f3fd9c603bfd9cef600316d5e76210e6cf54a7 (release/2.3)

Author: Steffan Karger
Date:   Thu Mar 26 01:01:29 2015 +0100
     Remove unneeded parameter 'first_time' from possibility_become_daemon()

     Signed-off-by: Steffan Karger <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/9555
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering