all: use G_SPAWN_CLOEXEC_PIPES with g_spawn_async_with_pipes()

G_SPAWN_CLOEXEC_PIPES is supported since glib 2.40, which we already
depend on.
This commit is contained in:
Thomas Haller
2023-04-03 19:38:00 +02:00
parent 17ae6a4413
commit 31fd8f60cf
5 changed files with 6 additions and 5 deletions

View File

@@ -647,7 +647,7 @@ run_netconfig(NMDnsManager *self, GError **error, int *stdin_fd)
if (!g_spawn_async_with_pipes(NULL, if (!g_spawn_async_with_pipes(NULL,
argv, argv,
NULL, NULL,
G_SPAWN_DO_NOT_REAP_CHILD, G_SPAWN_CLOEXEC_PIPES | G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL,
NULL, NULL,
&pid, &pid,

View File

@@ -5108,7 +5108,7 @@ nm_utils_spawn_helper(const char *const *args,
if (!g_spawn_async_with_pipes("/", if (!g_spawn_async_with_pipes("/",
(char **) NM_MAKE_STRV(LIBEXECDIR "/nm-daemon-helper"), (char **) NM_MAKE_STRV(LIBEXECDIR "/nm-daemon-helper"),
(char **) NM_MAKE_STRV(), (char **) NM_MAKE_STRV(),
G_SPAWN_DO_NOT_REAP_CHILD, G_SPAWN_CLOEXEC_PIPES | G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL,
NULL, NULL,
&info->pid, &info->pid,

View File

@@ -107,7 +107,8 @@ nmtstc_service_init(void)
g_spawn_async_with_pipes(NULL, g_spawn_async_with_pipes(NULL,
(char **) args, (char **) args,
NULL, NULL,
G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, G_SPAWN_CLOEXEC_PIPES | G_SPAWN_SEARCH_PATH
| G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL,
NULL, NULL,
&info->pid, &info->pid,

View File

@@ -514,7 +514,7 @@ begin_authentication(AuthRequest *request)
if (!g_spawn_async_with_pipes(NULL, if (!g_spawn_async_with_pipes(NULL,
(char **) helper_argv, (char **) helper_argv,
NULL, NULL,
G_SPAWN_STDERR_TO_DEV_NULL, G_SPAWN_CLOEXEC_PIPES | G_SPAWN_STDERR_TO_DEV_NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,

View File

@@ -787,7 +787,7 @@ try_spawn_vpn_auth_helper(RequestData *request, GPtrArray *secrets)
if (!g_spawn_async_with_pipes(NULL, if (!g_spawn_async_with_pipes(NULL,
(char **) auth_dialog_argv->pdata, (char **) auth_dialog_argv->pdata,
NULL, NULL,
G_SPAWN_DO_NOT_REAP_CHILD, G_SPAWN_CLOEXEC_PIPES | G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL,
NULL, NULL,
&auth_dialog_pid, &auth_dialog_pid,