projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add tests for dump commands
[tinc]
/
src
/
process.c
diff --git
a/src/process.c
b/src/process.c
index
7d528f7
..
5e7b1db
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-25,7
+25,7
@@
#include "process.h"
#include "version.h"
#include "process.h"
#include "version.h"
-#ifdef HAVE_
MINGW
+#ifdef HAVE_
WINDOWS
#include "utils.h"
#endif
#include "utils.h"
#endif
@@
-33,12
+33,16
@@
bool do_detach = true;
extern char **g_argv;
bool do_detach = true;
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... */
/* Some functions the less gifted operating systems might lack... */
-#ifdef HAVE_
MINGW
+#ifdef HAVE_
WINDOWS
static SC_HANDLE manager = NULL;
static SC_HANDLE service = NULL;
static SERVICE_STATUS status = {0};
static SC_HANDLE manager = NULL;
static SC_HANDLE service = NULL;
static SERVICE_STATUS status = {0};
@@
-198,7
+202,7
@@
bool init_service(void) {
bool detach(void) {
logmode_t logmode;
bool detach(void) {
logmode_t logmode;
-#ifndef HAVE_
MINGW
+#ifndef HAVE_
WINDOWS
signal(SIGPIPE, SIG_IGN);
signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);
@@
-208,7
+212,7
@@
bool detach(void) {
#endif
if(do_detach) {
#endif
if(do_detach) {
-#ifndef HAVE_
MINGW
+#ifndef HAVE_
WINDOWS
if(daemon(1, 0)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Couldn't detach from terminal: %s", strerror(errno));
if(daemon(1, 0)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Couldn't detach from terminal: %s", strerror(errno));