summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-02-20 18:14:14 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2023-02-21 13:55:29 +0100
commit8e312f61689ce274f8f6d31a6c3464548632186c (patch)
tree0d83038307572aa375bd6a963b75d5b3e36ce807
parent422f086a680aa111ba1556d7e9ca70cf4fc4c34f (diff)
downloadNetworkManager-8e312f61689ce274f8f6d31a6c3464548632186c.tar.gz
core: change buffer allocation size for the daemon helper
Use slightly more efficient sizes. (cherry picked from commit 961824d43b5bd649ff98bb8fbf05d276faff82b6)
-rw-r--r--src/core/nm-core-utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c
index 9448ba7b03..da129eb696 100644
--- a/src/core/nm-core-utils.c
+++ b/src/core/nm-core-utils.c
@@ -5132,7 +5132,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');
@@ -5146,7 +5146,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,