Mercurial > dovecot > core-2.2
changeset 9184:afdeb38c338f HEAD
master: Removed unused code.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 30 Apr 2009 18:01:23 -0400 |
parents | bfe448b4951f |
children | 637b627efbf1 |
files | src/master/master-settings.c |
diffstat | 1 files changed, 0 insertions(+), 95 deletions(-) [+] |
line wrap: on
line diff
--- a/src/master/master-settings.c Thu Apr 30 18:01:10 2009 -0400 +++ b/src/master/master-settings.c Thu Apr 30 18:01:23 2009 -0400 @@ -287,98 +287,3 @@ } return TRUE; } - -#if 0 //FIXME -static struct master_settings * -master_settings_read_fd(pool_t pool, int fd, const char **error_r) -{ - struct setting_parser_context *parser; - struct master_settings *set; - struct istream *input; - int ret; - - parser = settings_parser_init(pool, &master_setting_parser_info, - SETTINGS_PARSER_FLAG_IGNORE_UNKNOWN_KEYS); - input = i_stream_create_fd(fd, 1024, FALSE); - ret = settings_parse_stream_read(parser, input); - i_stream_unref(&input); - - if (ret == 0) { - *error_r = NULL; - set = settings_parser_get(parser); - } else { - *error_r = t_strdup_printf( - "master: Error reading configuration: %s", - settings_parser_get_error(parser)); - set = NULL; - } - settings_parser_deinit(&parser); - - return set; -} - -struct master_settings * -master_settings_read(pool_t pool, const char *config_binary, - const char *config_path) -{ - struct master_settings *set; - const char *error; - pid_t pid; - int fd[2], status; - - if (pipe(fd) < 0) { - i_error("pipe() failed: %m"); - return NULL; - } - - pid = fork(); - if (pid < 0) { - i_error("fork() failed: %m"); - (void)close(fd[0]); - (void)close(fd[1]); - return NULL; - } - - if (pid == 0) { - /* child */ - const char *argv[3] = { "-c", config_path, NULL }; - - if (dup2(fd[1], STDOUT_FILENO) < 0) - i_fatal("dup2(stdout) failed: %m"); - (void)close(fd[0]); - (void)close(fd[1]); - - env_put("MASTER_INIT=1"); - process_exec(config_binary, argv); - } - - /* parent. */ - (void)close(fd[1]); - - set = master_settings_read_fd(pool, fd[0], &error); - if (close(fd[0]) < 0) - i_error("close(setpipe) failed: %m"); - - /* if config process doesn't return successfully, assume the returned - configuration is invalid */ - if (waitpid(pid, &status, 0) < 0) { - i_error("waitpid(config) failed: %m"); - set = NULL; - } else if (status != 0) { - if (!WIFEXITED(status) || WEXITSTATUS(status) != FATAL_DEFAULT) - process_log_status_error(pid, "config", status); - set = NULL; - } else if (set == NULL) { - i_error("%s", error); - } - - if (set != NULL) { - if (!master_settings_verify(set)) - set = NULL; - else if (!settings_do_fixes(set)) - set = NULL; - } - - return set; -} -#endif