1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 00:04:57 +03:00

UNIX services write logs to stdout

To better adopt SoftEther VPN for execution in Docker container all
services output logs to stdout if running in foreground.
This commit is contained in:
Mikhail Pridushchenko
2017-06-28 16:22:53 +03:00
committed by Joshua Perry
parent 825931e11c
commit 02da8079ee
5 changed files with 331 additions and 237 deletions

View File

@ -1703,6 +1703,23 @@ void *UnixFileOpen(char *name, bool write_mode, bool read_lock)
return (void *)p;
}
// Get UNIXIO object for stdout
void* GetUnixio4Stdout()
{
static UNIXIO unixio =
{
.fd = -1,
.write_mode = true
};
if (g_foreground)
{
unixio.fd = STDOUT_FILENO;
return &unixio;
}
return NULL;
}
// Return the current thread ID
UINT UnixThreadId()
{