The write_pid() function is only used in openvpn.c, so no
need to have that in the misc.[ch] mixed bag.

Signed-off-by: David Sommerseth <dav...@openvpn.net>
---
 src/openvpn/misc.c    | 21 ---------------------
 src/openvpn/misc.h    |  2 --
 src/openvpn/openvpn.c | 21 +++++++++++++++++++++
 3 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
index ae96aa69..8a76bba8 100644
--- a/src/openvpn/misc.c
+++ b/src/openvpn/misc.c
@@ -142,27 +142,6 @@ run_up_down(const char *command,
     gc_free(&gc);
 }
 
-/* Write our PID to a file */
-void
-write_pid(const char *filename)
-{
-    if (filename)
-    {
-        unsigned int pid = 0;
-        FILE *fp = platform_fopen(filename, "w");
-        if (!fp)
-        {
-            msg(M_ERR, "Open error on pid file %s", filename);
-        }
-
-        pid = platform_getpid();
-        fprintf(fp, "%u\n", pid);
-        if (fclose(fp))
-        {
-            msg(M_ERR, "Close error on pid file %s", filename);
-        }
-    }
-}
 
 /*
  * Set standard file descriptors to /dev/null
diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h
index 32b64e8b..734e679c 100644
--- a/src/openvpn/misc.h
+++ b/src/openvpn/misc.h
@@ -68,8 +68,6 @@ void run_up_down(const char *command,
                  const char *script_type,
                  struct env_set *es);
 
-void write_pid(const char *filename);
-
 /* system flags */
 #define S_SCRIPT (1<<0)
 #define S_FATAL  (1<<1)
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c
index 08c09e6b..794de1a8 100644
--- a/src/openvpn/openvpn.c
+++ b/src/openvpn/openvpn.c
@@ -47,6 +47,27 @@ process_signal_p2p(struct context *c)
     return process_signal(c);
 }
 
+/* Write our PID to a file */
+static void
+write_pid(const char *filename)
+{
+    if (filename)
+    {
+        unsigned int pid = 0;
+        FILE *fp = platform_fopen(filename, "w");
+        if (!fp)
+        {
+            msg(M_ERR, "Open error on pid file %s", filename);
+        }
+
+        pid = platform_getpid();
+        fprintf(fp, "%u\n", pid);
+        if (fclose(fp))
+        {
+            msg(M_ERR, "Close error on pid file %s", filename);
+        }
+    }
+}
 
 
 /**************************************************************************/
-- 
2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to