mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 16:08:29 +02:00
core: change buffer allocation size for the daemon helper
Use slightly more efficient sizes. (cherry picked from commit961824d43b) (cherry picked from commit8e312f6168)
This commit is contained in:
parent
b681bcec1d
commit
f4c7d3aa82
1 changed files with 2 additions and 2 deletions
|
|
@ -5126,7 +5126,7 @@ nm_utils_spawn_helper(const char *const *args,
|
||||||
fcntl(info->child_stdout, F_SETFL, fd_flags | O_NONBLOCK);
|
fcntl(info->child_stdout, F_SETFL, fd_flags | O_NONBLOCK);
|
||||||
|
|
||||||
/* Watch process stdin */
|
/* 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++) {
|
for (arg = args; *arg; arg++) {
|
||||||
nm_str_buf_append(&info->out_buffer, *arg);
|
nm_str_buf_append(&info->out_buffer, *arg);
|
||||||
nm_str_buf_append_c(&info->out_buffer, '\0');
|
nm_str_buf_append_c(&info->out_buffer, '\0');
|
||||||
|
|
@ -5140,7 +5140,7 @@ nm_utils_spawn_helper(const char *const *args,
|
||||||
g_source_attach(info->output_source, g_main_context_get_thread_default());
|
g_source_attach(info->output_source, g_main_context_get_thread_default());
|
||||||
|
|
||||||
/* Watch process stdout */
|
/* 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,
|
info->input_source = nm_g_unix_fd_source_new(info->child_stdout,
|
||||||
G_IO_IN | G_IO_ERR | G_IO_HUP,
|
G_IO_IN | G_IO_ERR | G_IO_HUP,
|
||||||
G_PRIORITY_DEFAULT,
|
G_PRIORITY_DEFAULT,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue