diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-02 06:57:11 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-02 06:57:11 +0200 |
commit | 5196d94f84f23057406cb15be7c49a39a05f912d (patch) | |
tree | a47dad26e006bd9aa52e7de32c39d75965a2a98d /src/openvpn/openvpn.c | |
parent | 1cc61feca65e1593f3cbe69af692e31c3042a8a6 (diff) | |
parent | a6daf938f5f616a4a67caa6580b0c99e9a8c3779 (diff) |
Updated version 2.4.4 from 'upstream/2.4.4'
with Debian dir 140f8169d27cc56f891366cfbea8aff1659cd942
Diffstat (limited to 'src/openvpn/openvpn.c')
-rw-r--r-- | src/openvpn/openvpn.c | 22 |
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); + } + } +} /**************************************************************************/ |