]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Removed unused code.
authorTimo Sirainen <tss@iki.fi>
Thu, 30 Apr 2009 22:01:23 +0000 (18:01 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 30 Apr 2009 22:01:23 +0000 (18:01 -0400)
--HG--
branch : HEAD

src/master/master-settings.c

index af9181082b36631154ec76054024c2d439c6697f..76c55e008e6409696be2049348a7f05d291d94de 100644 (file)
@@ -287,98 +287,3 @@ bool master_settings_do_fixes(const struct master_settings *set)
        }
        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