From: Yuri Pudgorodskiy <[email protected]>

This was original behaviour before GLIB gspawn() rework and we rely on
this behaviour.

Signed-off-by: Yuri Pudgorodskiy <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
CC: Michael Roth <[email protected]>
* add version check (2.33.2) for G_SPAWN_SEARCH_PATH_FROM_ENVP
Signed-off-by: Michael Roth <[email protected]>
---
 qga/commands.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qga/commands.c b/qga/commands.c
index 7644ca0..bb73e7d 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -401,6 +401,9 @@ GuestExec *qmp_guest_exec(const char *path,
     envp = has_env ? guest_exec_get_args(env, false) : NULL;
 
     flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD;
+#if GLIB_CHECK_VERSION(2, 33, 2)
+    flags |= G_SPAWN_SEARCH_PATH_FROM_ENVP;
+#endif
     if (!has_output) {
         flags |= G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL;
     }
-- 
1.9.1


Reply via email to