diff options
author | Colin Walters <walters@verbum.org> | 2016-03-18 16:46:42 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2016-03-23 10:26:01 -0400 |
commit | 614483ecd174c3e5f9c048ebd517d186c88caa89 (patch) | |
tree | 30ae02cea7800e4cd1dc9ca839b7f0d8487ef561 /src/ostree/ot-editor.c | |
parent | afb6105a51478b7f2ff7427f14fdfc17119df0ed (diff) | |
download | ostree-614483ecd174c3e5f9c048ebd517d186c88caa89.tar.gz |
Use GSubprocess instead of GSSubprocess (libgsystem removal)
Since we hard-depend on GLib 2.40, we can start using GSubprocess.
This is part of dropping our dependency on libgsystem, which is
deprecated in favor of libglnx (as well as migrating things to GLib).
Diffstat (limited to 'src/ostree/ot-editor.c')
-rw-r--r-- | src/ostree/ot-editor.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/ostree/ot-editor.c b/src/ostree/ot-editor.c index 2b2101f6..4c29c81e 100644 --- a/src/ostree/ot-editor.c +++ b/src/ostree/ot-editor.c @@ -62,8 +62,7 @@ ot_editor_prompt (OstreeRepo *repo, GCancellable *cancellable, GError **error) { - glnx_unref_object GSSubprocessContext *ctx = NULL; - glnx_unref_object GSSubprocess *proc = NULL; + glnx_unref_object GSubprocess *proc = NULL; g_autoptr(GFile) file = NULL; g_autoptr(GFileIOStream) io = NULL; GOutputStream *output; @@ -92,16 +91,11 @@ ot_editor_prompt (OstreeRepo *repo, g_autofree char *quoted_file = g_shell_quote (gs_file_get_path_cached (file)); args = g_strconcat (editor, " ", quoted_file, NULL); } - ctx = gs_subprocess_context_newv ("/bin/sh", "-c", args, NULL); - gs_subprocess_context_set_stdin_disposition (ctx, GS_SUBPROCESS_STREAM_DISPOSITION_INHERIT); - gs_subprocess_context_set_stdout_disposition (ctx, GS_SUBPROCESS_STREAM_DISPOSITION_INHERIT); - gs_subprocess_context_set_stderr_disposition (ctx, GS_SUBPROCESS_STREAM_DISPOSITION_INHERIT); - proc = gs_subprocess_new (ctx, cancellable, error); - if (proc == NULL) - goto out; + proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDIN_INHERIT, error, + "/bin/sh", "-c", args, NULL); - if (!gs_subprocess_wait_sync_check (proc, cancellable, error)) + if (!g_subprocess_wait_check (proc, cancellable, error)) { g_prefix_error (error, "There was a problem with the editor '%s'", editor); goto out; |