core: use nm_clear_fd() helper in nm_utils_spawn_helper()

This commit is contained in:
Thomas Haller
2023-03-28 11:02:32 +02:00
parent a26c79e495
commit b5875ec79e

View File

@@ -4913,13 +4913,9 @@ helper_info_free(gpointer data)
nm_clear_g_source_inst(&info->input_source); nm_clear_g_source_inst(&info->input_source);
nm_clear_g_source_inst(&info->output_source); nm_clear_g_source_inst(&info->output_source);
nm_clear_g_source_inst(&info->error_source); nm_clear_g_source_inst(&info->error_source);
nm_clear_fd(&info->child_stdout);
if (info->child_stdout != -1) nm_clear_fd(&info->child_stdin);
nm_close(info->child_stdout); nm_clear_fd(&info->child_stderr);
if (info->child_stdin != -1)
nm_close(info->child_stdin);
if (info->child_stderr != -1)
nm_close(info->child_stderr);
if (info->pid != -1) { if (info->pid != -1) {
nm_assert(info->pid > 1); nm_assert(info->pid > 1);
@@ -5015,8 +5011,7 @@ helper_have_data(int fd, GIOCondition condition, gpointer user_data)
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
nm_clear_g_source_inst(&info->input_source); nm_clear_g_source_inst(&info->input_source);
nm_close(info->child_stdout); nm_clear_fd(&info->child_stdout);
info->child_stdout = -1;
_LOG2T(info, "stdout closed"); _LOG2T(info, "stdout closed");
@@ -5044,9 +5039,7 @@ helper_have_err_data(int fd, GIOCondition condition, gpointer user_data)
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
nm_clear_g_source_inst(&info->error_source); nm_clear_g_source_inst(&info->error_source);
nm_close(info->child_stderr); nm_clear_fd(&info->child_stderr);
info->child_stderr = -1;
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
} }