]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
init: make some functions static master
authorAntonio Quartulli <antonio@mandelbit.com>
Tue, 4 Nov 2025 10:44:48 +0000 (11:44 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 4 Nov 2025 17:21:27 +0000 (18:21 +0100)
A bunch of functions are defined and used within init.c only.
We can therefore drop their declaration in init.h and make
them static.

Change-Id: I2b5429841bcd46376241890ace50b82a291b7400
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346
Message-Id: <20251104104448.98093-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34193.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c
src/openvpn/init.h

index 1bdaf277dd69ee5c77461e036deb18e9488f328e..8d95d5c1f747e7302a1102662c9ebe4d9e2796ca 100644 (file)
@@ -71,13 +71,13 @@ static void do_init_first_time(struct context *c);
 
 static bool do_deferred_p2p_ncp(struct context *c);
 
-void
+static void
 context_clear(struct context *c)
 {
     CLEAR(*c);
 }
 
-void
+static void
 context_clear_1(struct context *c)
 {
     CLEAR(c->c1);
@@ -4429,33 +4429,10 @@ persist_client_stats(struct context *c)
 #endif
 }
 
-/*
- * Initialize a tunnel instance, handle pre and post-init
- * signal settings.
- */
-void
-init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
-{
-    pre_init_signal_catch();
-    init_instance(c, env, flags);
-    post_init_signal_catch();
-
-    /*
-     * This is done so that signals thrown during
-     * initialization can bring us back to
-     * a management hold.
-     */
-    if (IS_SIG(c))
-    {
-        remap_signal(c);
-        uninit_management_callback();
-    }
-}
-
 /*
  * Initialize a tunnel instance.
  */
-void
+static void
 init_instance(struct context *c, const struct env_set *env, const unsigned int flags)
 {
     const struct options *options = &c->options;
@@ -4744,6 +4721,29 @@ sig:
     return;
 }
 
+/*
+ * Initialize a tunnel instance, handle pre and post-init
+ * signal settings.
+ */
+void
+init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
+{
+    pre_init_signal_catch();
+    init_instance(c, env, flags);
+    post_init_signal_catch();
+
+    /*
+     * This is done so that signals thrown during
+     * initialization can bring us back to
+     * a management hold.
+     */
+    if (IS_SIG(c))
+    {
+        remap_signal(c);
+        uninit_management_callback();
+    }
+}
+
 /*
  * Close a tunnel instance.
  */
index e89615bcb30c9fa624297c4ba82cb114df8217f4..97318ec61917d8c308bfe5b55e201d202ba804e2 100644 (file)
  */
 #define BASE_N_EVENTS 5
 
-void context_clear(struct context *c);
-
-void context_clear_1(struct context *c);
-
 void context_clear_2(struct context *c);
 
 void context_init_1(struct context *c);
@@ -64,8 +60,6 @@ void pre_setup(const struct options *options);
 void init_instance_handle_signals(struct context *c, const struct env_set *env,
                                   const unsigned int flags);
 
-void init_instance(struct context *c, const struct env_set *env, const unsigned int flags);
-
 /**
  * Query for private key and auth-user-pass username/passwords.
  */