diff options
author | Thomas Haller <thaller@redhat.com> | 2023-03-30 08:16:25 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-04-03 10:27:43 +0200 |
commit | a52d620549acb419056342fc978914cffaf8bedb (patch) | |
tree | 6cf09dc5bcc285b61a8e0362f8c32d72634415ae | |
parent | 3411f4241892eb6953dd314e72a162fb38a03f11 (diff) |
core: assert that nm_utils_spawn_helper() is used with default context
-rw-r--r-- | src/core/nm-core-utils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 7e428a7f4f..1af875d796 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -5138,6 +5138,12 @@ nm_utils_spawn_helper(const char *const *args, context = g_task_get_context(info->task); + /* The async function makes a lukewarm attempt to honor the current thread default + * context. However, it later uses nm_utils_kill_child_async() which always uses + * g_main_context_default(). For now, the function really can only be used with the + * main context. */ + nm_assert(context == g_main_context_default()); + info->child_watch_source = g_child_watch_source_new(info->pid); g_source_set_callback(info->child_watch_source, G_SOURCE_FUNC(helper_child_terminated), |