dovecot-2.0: master: Removed unused code.
dovecot at dovecot.org
dovecot at dovecot.org
Fri May 1 01:01:29 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/afdeb38c338f
changeset: 9184:afdeb38c338f
user: Timo Sirainen <tss at iki.fi>
date: Thu Apr 30 18:01:23 2009 -0400
description:
master: Removed unused code.
diffstat:
1 file changed, 95 deletions(-)
src/master/master-settings.c | 95 ------------------------------------------
diffs (102 lines):
diff -r bfe448b4951f -r afdeb38c338f src/master/master-settings.c
--- 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 @@ bool master_settings_do_fixes(const stru
}
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
More information about the dovecot-cvs
mailing list