X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprocess.c;h=7deaadfcb3fa366be316e559bc6731c8208cf6e3;hb=3b117ab744100ca48f257ec6c9df83757cad8224;hp=f596eb6cf84a2fa6d785d42b70c4de5d01d08125;hpb=1545909dcb3ac618754486f4ccd4d8f237d64bb7;p=tinc diff --git a/src/process.c b/src/process.c index f596eb6c..7deaadfc 100644 --- a/src/process.c +++ b/src/process.c @@ -31,11 +31,14 @@ /* If zero, don't detach from the terminal. */ bool do_detach = true; -bool sigalrm = false; extern char **g_argv; -extern bool use_logfile; -extern bool use_syslog; + +/* If nonzero, use syslog instead of stderr in no-detach mode. */ +bool use_syslog = false; + +/* If nonzero, write log entries to a separate file. */ +bool use_logfile = false; /* Some functions the less gifted operating systems might lack... */ @@ -47,7 +50,8 @@ static SERVICE_STATUS_HANDLE statushandle = 0; static bool install_service(void) { char command[4096] = "\""; - SERVICE_DESCRIPTION description = {"Virtual Private Network daemon"}; + char description_buffer[] = "Virtual Private Network daemon"; + SERVICE_DESCRIPTION description = {description_buffer}; manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); @@ -108,7 +112,7 @@ static bool install_service(void) { io_t stop_io; -DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID data, LPVOID context) { +static DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID data, LPVOID context) { (void)type; (void)data; (void)context; @@ -142,7 +146,7 @@ DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID data, LPVOID conte return NO_ERROR; } -VOID WINAPI run_service(DWORD argc, LPTSTR *argv) { +static VOID WINAPI run_service(DWORD argc, LPTSTR *argv) { extern int main2(int argc, char **argv); status.dwServiceType = SERVICE_WIN32;