Mercurial > dovecot > original-hg > dovecot-1.2
diff src/master/main.c @ 697:7814b29d0862 HEAD
Created env_put() and env_clean() for a bit easier handling of environment
variables.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 26 Nov 2002 21:49:06 +0200 |
parents | 90a65c017bf0 |
children | 8dd8ebe6bcac |
line wrap: on
line diff
--- a/src/master/main.c Tue Nov 26 21:30:34 2002 +0200 +++ b/src/master/main.c Tue Nov 26 21:49:06 2002 +0200 @@ -4,6 +4,7 @@ #include "ioloop.h" #include "lib-signals.h" #include "network.h" +#include "env-util.h" #include "auth-process.h" #include "login-process.h" @@ -46,21 +47,14 @@ void clean_child_process(void) { - extern char **environ; - /* remove all environment, we don't need them */ - if (environ != NULL) - *environ = NULL; + env_clean(); /* set the failure log */ - if (set_log_path != NULL) { - putenv((char *) t_strconcat("IMAP_LOGFILE=", - set_log_path, NULL)); - } - if (set_log_timestamp != NULL) { - putenv((char *) t_strconcat("IMAP_LOGSTAMP=", - set_log_timestamp, NULL)); - } + if (set_log_path != NULL) + env_put(t_strconcat("IMAP_LOGFILE=", set_log_path, NULL)); + if (set_log_timestamp != NULL) + env_put(t_strconcat("IMAP_LOGSTAMP=", set_log_timestamp, NULL)); (void)close(null_fd); (void)close(imap_fd);