From: Aki Tuomi Date: Thu, 29 Aug 2024 11:26:15 +0000 (+0300) Subject: master: Use new var_expand X-Git-Tag: 2.4.0~312 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8815bcf4c282ef84f66b3db2d9ab9961554e272f;p=thirdparty%2Fdovecot%2Fcore.git master: Use new var_expand --- diff --git a/src/imap-hibernate/imap-client.c b/src/imap-hibernate/imap-client.c index bd0cd75a7e..99771bc985 100644 --- a/src/imap-hibernate/imap-client.c +++ b/src/imap-hibernate/imap-client.c @@ -657,7 +657,7 @@ imap_client_create(int fd, const struct imap_client_state *state) const struct var_expand_params params = { .table = imap_client_get_var_expand_table(client), .providers = funcs, - .provider_context = fields, + .context = fields, .event = client->event, }; string_t *str; diff --git a/src/master/service-process.c b/src/master/service-process.c index 2d6b8dd9d7..83c2937840 100644 --- a/src/master/service-process.c +++ b/src/master/service-process.c @@ -17,7 +17,7 @@ #include "restrict-access.h" #include "restrict-process-size.h" #include "eacces-error.h" -#include "var-expand.h" +#include "var-expand-new.h" #include "master-service.h" #include "master-service-settings.h" #include "dup2-array.h" @@ -56,14 +56,15 @@ static int service_unix_pid_listener_get_path(struct service_listener *l, pid_t pid, string_t *path, const char **error_r) { - struct var_expand_table var_table[] = { - { '\0', dec2str(pid), "pid" }, - { '\0', NULL, NULL }, + const struct var_expand_params params = { + .table = (const struct var_expand_table[]) { + { .key = "pid", .value = dec2str(pid) }, + VAR_EXPAND_TABLE_END + }, }; str_truncate(path, 0); - return var_expand_with_table(path, l->set.fileset.set->path, var_table, - error_r); + return var_expand_new(path, l->set.fileset.set->path, ¶ms, error_r); } static void @@ -153,7 +154,7 @@ service_dup_fds(struct service *service) array_foreach(&service->unix_pid_listeners, listenerp) { l = *listenerp; ret = service_unix_pid_listener_get_path(l, pid, path, &error); - if (ret > 0) { + if (ret == 0) { ret = service_unix_listener_listen(l, str_c(path), FALSE, &error); } @@ -461,7 +462,7 @@ void service_process_destroy(struct service_process *process) array_foreach(&service->unix_pid_listeners, listenerp) { str_truncate(path, 0); if (service_unix_pid_listener_get_path(*listenerp, - process->pid, path, &error) > 0) + process->pid, path, &error) == 0) i_unlink_if_exists(str_c(path)); } }