Mercurial > dovecot > core-2.2
diff src/pop3/main.c @ 9348:0c587f108916 HEAD
lib-master has now a global master_service variable that all binaries use.
There should always be only one of them anyway.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 22 May 2009 17:26:27 -0400 |
parents | 5d0a69504867 |
children | d6d4ec8ac06d |
line wrap: on
line diff
--- a/src/pop3/main.c Fri May 22 13:07:17 2009 -0400 +++ b/src/pop3/main.c Fri May 22 17:26:27 2009 -0400 @@ -18,7 +18,6 @@ #define IS_STANDALONE() \ (getenv("LOGGED_IN") == NULL) -struct master_service *service; void (*hook_client_created)(struct client **client) = NULL; static struct io *log_io = NULL; @@ -28,7 +27,7 @@ /* the log fd is closed, don't die when trying to log later */ i_set_failure_ignore_errors(TRUE); - master_service_stop(service); + master_service_stop(master_service); } static bool main_init(const struct pop3_settings *set, struct mail_user *user) @@ -105,9 +104,9 @@ else service_flags |= MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT; - service = master_service_init("pop3", service_flags, argc, argv); + master_service = master_service_init("pop3", service_flags, argc, argv); while ((c = getopt(argc, argv, master_service_getopt_string())) > 0) { - if (!master_service_parse_option(service, c, optarg)) + if (!master_service_parse_option(master_service, c, optarg)) exit(FATAL_DEFAULT); } @@ -126,9 +125,10 @@ if ((value = getenv("LOCAL_IP")) != NULL) net_addr2ip(value, &input.local_ip); - mail_user = mail_storage_service_init_user(service, &input, set_roots, + mail_user = mail_storage_service_init_user(master_service, + &input, set_roots, storage_service_flags); - set = mail_storage_service_get_settings(service); + set = mail_storage_service_get_settings(master_service); restrict_access_allow_coredumps(TRUE); process_title_init(argv, envp); @@ -138,10 +138,10 @@ io_loop_set_running(current_ioloop); if (main_init(set, mail_user)) - master_service_run(service, client_connected); + master_service_run(master_service, client_connected); main_deinit(); mail_storage_service_deinit_user(); - master_service_deinit(&service); + master_service_deinit(&master_service); return 0; }