summaryrefslogtreecommitdiff
path: root/src/openvpn/openvpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvpn/openvpn.c')
-rw-r--r--src/openvpn/openvpn.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c
index 08c09e6..e237ee5 100644
--- a/src/openvpn/openvpn.c
+++ b/src/openvpn/openvpn.c
@@ -33,6 +33,7 @@
#include "forward.h"
#include "multi.h"
#include "win32.h"
+#include "platform.h"
#include "memdbg.h"
@@ -47,6 +48,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);
+ }
+ }
+}
/**************************************************************************/