The write_pid() function is only used in openvpn.c, so no
need to have that in the misc.[ch] mixed bag.
[on-the-fly change: Added #include "platform.h"]
Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <
20170725145718.13175-1-davids@openvpn.net>
URL: https://www.mail-archive.com/search?l=mid&q=
20170725145718.13175-1-davids@openvpn.net
Signed-off-by: David Sommerseth <davids@openvpn.net>
(cherry picked from commit
c5b12817c9aa3ae97fbdd2c2a9a9ab605087dff1)
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
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)
#include "forward.h"
#include "multi.h"
#include "win32.h"
+#include "platform.h"
#include "memdbg.h"
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);
+ }
+ }
+}
/**************************************************************************/