common: Add GSubprocessFlags to flatpak_spawnv

This is useful to e.g. hide stderr
This commit is contained in:
Alexander Larsson
2017-08-18 10:56:15 +02:00
parent 85ba1f75eb
commit 4e15d9a5f8
6 changed files with 10 additions and 6 deletions

View File

@@ -304,7 +304,7 @@ builder_git_mirror_repo (const char *repo_location,
g_ptr_array_add (args, filename_tmp);
g_ptr_array_add (args, NULL);
res = flatpak_spawnv (parent, NULL, error,
res = flatpak_spawnv (parent, NULL, 0, error,
(const gchar * const *) args->pdata);
if (cached_git_dir && !update &&

View File

@@ -383,7 +383,7 @@ unrpm (GFile *dir,
rpm_path, /* shell's $1 */
NULL };
res = flatpak_spawnv (dir, NULL, error, argv);
res = flatpak_spawnv (dir, NULL, 0, error, argv);
return res;
}

View File

@@ -222,7 +222,7 @@ patch (GFile *dir,
}
g_ptr_array_add (args, NULL);
res = flatpak_spawnv (dir, NULL, error, (const char **) args->pdata);
res = flatpak_spawnv (dir, NULL, 0, error, (const char **) args->pdata);
g_ptr_array_free (args, TRUE);

View File

@@ -1597,7 +1597,7 @@ builder_maybe_host_spawnv (GFile *dir,
if (flatpak_is_in_sandbox ())
return builder_host_spawnv (dir, output, error, argv);
return flatpak_spawnv (dir, output, error, argv);
return flatpak_spawnv (dir, output, 0, error, argv);
}
typedef struct {

View File

@@ -1956,7 +1956,7 @@ flatpak_spawn (GFile *dir,
g_ptr_array_add (args, (gchar *) arg);
g_ptr_array_add (args, NULL);
res = flatpak_spawnv (dir, output, error, (const gchar * const *) args->pdata);
res = flatpak_spawnv (dir, output, 0, error, (const gchar * const *) args->pdata);
g_ptr_array_free (args, TRUE);
@@ -1966,6 +1966,7 @@ flatpak_spawn (GFile *dir,
gboolean
flatpak_spawnv (GFile *dir,
char **output,
GSubprocessFlags flags,
GError **error,
const gchar * const *argv)
{
@@ -1980,7 +1981,9 @@ flatpak_spawnv (GFile *dir,
launcher = g_subprocess_launcher_new (0);
if (output)
g_subprocess_launcher_set_flags (launcher, G_SUBPROCESS_FLAGS_STDOUT_PIPE);
flags |= G_SUBPROCESS_FLAGS_STDOUT_PIPE;
g_subprocess_launcher_set_flags (launcher, flags);
if (dir)
{

View File

@@ -405,6 +405,7 @@ gboolean flatpak_spawn (GFile *dir,
gboolean flatpak_spawnv (GFile *dir,
char **output,
GSubprocessFlags flags,
GError **error,
const gchar * const *argv);