int relh=0;
int home=0;
int dbg=0;
+ int have_minus_x=0;
char relhome[PATH_MAX]="";
char ctdldir[PATH_MAX]=CTDLDIR;
#ifdef HAVE_RUN_DIR
/* run in the background if -d was specified */
else if (!strcmp(argv[a], "-d")) {
running_as_daemon = 1;
+ if (!have_minus_x)
+ print_to_logfile = 0;
}
/* run a few stats if -s was specified */
/* -x specifies the desired logging level */
else if (!strncmp(argv[a], "-x", 2)) {
verbosity = atoi(&argv[a][2]);
+ have_minus_x = 1;
+ print_to_logfile = 1;
}
else if (!strncmp(argv[a], "-h", 2)) {
int syslog_facility = LOG_DAEMON;
int enable_syslog = 0;
-
+int print_to_logfile = 1;
/*
* CtdlLogPrintf() ... Write logging information
}
/* stderr output code */
- if (enable_syslog || running_as_daemon) return;
+ if (enable_syslog || !print_to_logfile) return;
/* if we run in forground and syslog is disabled, log to terminal */
if (loglevel <= verbosity) {
void vCtdlLogPrintf (enum LogLevel loglevel, const char *format, va_list arg_ptr);
extern int enable_syslog;
+extern int print_to_logfile;
void init_sysdep (void);
int ig_tcp_server (char *ip_addr, int port_number, int queue_len,char **errormessage);