diff --git a/source/.version b/source/.version index 48b91fd..8b95abd 100644 --- a/source/.version +++ b/source/.version @@ -1 +1 @@ -0.24.1 +0.24.2 diff --git a/source/bforce/logger.c b/source/bforce/logger.c index c8e9a3e..c2f3541 100644 --- a/source/bforce/logger.c +++ b/source/bforce/logger.c @@ -26,6 +26,7 @@ static char log_name[BF_MAXPATH+1] = BFORCE_LOGFILE; static char log_extension[32] = ""; static char log_ident[32] = ""; static char log_ttyname[32] = ""; +static int log_sl_opened = FALSE; #ifdef DEBUG /* @@ -291,7 +292,7 @@ const char *log_getfilename(int whatfor) bool log_isopened(void) { - return TRUE; + return log_sl_opened; } int log_open(const char *logname, const char *ext, const char *tty) @@ -299,14 +300,17 @@ int log_open(const char *logname, const char *ext, const char *tty) char *p = "bforce"; int fac = conf_number(cf_syslog_facility); if( tty && *tty ) - strncpy(p, tty, sizeof(p)); + strncpy(tty, p, sizeof(p)); openlog(p, LOG_PID, fac); + log_sl_opened = TRUE; return 0; } int log_reopen(const char *logname, const char *ext, const char *tty) { - return 0; + if (!log_sl_opened) { + return log_open(logname, ext, tty); + } else return 0; } int log_close(void) diff --git a/source/bforce/os_unix.c b/source/bforce/os_unix.c index c3ddb19..ce08e07 100644 --- a/source/bforce/os_unix.c +++ b/source/bforce/os_unix.c @@ -79,8 +79,8 @@ void exec_options_init(s_exec_options *eopt) eopt->envp[0] = NULL; i = 0; while(mainenv[i]) { - log("EXEC: Added ENV variable: %s\n", mainenv[i]); - eopt->envp[i] = malloc(strlen(mainenv[i]) + 2); + DEB((D_FREE, "EXEC: Added ENV variable: %s\n", mainenv[i])); + eopt->envp[i] = xmalloc(strlen(mainenv[i]) + 2); sprintf(eopt->envp[i], mainenv[i]); eopt->envp[++i] = NULL; } @@ -109,6 +109,7 @@ void exec_env_add(s_exec_options *eopt, const char *name, const char *value) { eopt->envp[i] = xmalloc(strlen(name) + strlen(value) + 2); sprintf(eopt->envp[i], "%s=%s", name, value); + DEB((D_FREE, "EXEC: Added ENV variable: %s=%s\n", name, value)); eopt->envp[i+1] = NULL; } }