From 961824d43b5bd649ff98bb8fbf05d276faff82b6 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 20 Feb 2023 18:14:14 +0100 Subject: [PATCH] core: change buffer allocation size for the daemon helper Use slightly more efficient sizes. --- src/core/nm-core-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 53afaa547a..2c251855bf 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -5130,7 +5130,7 @@ nm_utils_spawn_helper(const char *const *args, fcntl(info->child_stdout, F_SETFL, fd_flags | O_NONBLOCK); /* Watch process stdin */ - info->out_buffer = NM_STR_BUF_INIT(32, TRUE); + info->out_buffer = NM_STR_BUF_INIT(NM_UTILS_GET_NEXT_REALLOC_SIZE_40, TRUE); for (arg = args; *arg; arg++) { nm_str_buf_append(&info->out_buffer, *arg); nm_str_buf_append_c(&info->out_buffer, '\0'); @@ -5144,7 +5144,7 @@ nm_utils_spawn_helper(const char *const *args, g_source_attach(info->output_source, g_main_context_get_thread_default()); /* Watch process stdout */ - info->in_buffer = NM_STR_BUF_INIT(NM_UTILS_GET_NEXT_REALLOC_SIZE_1000, FALSE); + info->in_buffer = NM_STR_BUF_INIT(0, FALSE); info->input_source = nm_g_unix_fd_source_new(info->child_stdout, G_IO_IN | G_IO_ERR | G_IO_HUP, G_PRIORITY_DEFAULT,