[glib/wip/gsubprocess: 3/3] GSubprocess: Delete _set_standard_{output, error}_file_path() for now
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gsubprocess: 3/3] GSubprocess: Delete _set_standard_{output, error}_file_path() for now
- Date: Mon, 21 May 2012 19:16:34 +0000 (UTC)
commit 66f228464d18e587cbc1859c72e51a2d93b332ca
Author: Colin Walters <walters verbum org>
Date: Mon May 21 15:14:28 2012 -0400
GSubprocess: Delete _set_standard_{output,error}_file_path() for now
https://bugzilla.gnome.org/show_bug.cgi?id=672102
docs/reference/gio/gio-sections.txt | 2 -
gio/gio.symbols | 2 -
gio/gsubprocess.c | 130 ++---------------------------------
gio/gsubprocess.h | 8 --
4 files changed, 5 insertions(+), 137 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 3e3f7be..73f96ca 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -3915,7 +3915,6 @@ g_subprocess_set_environment
g_subprocess_set_io_priority
g_subprocess_set_leave_descriptors_open
g_subprocess_set_use_search_path
-g_subprocess_set_standard_error_file_path
g_subprocess_set_standard_error_to_devnull
g_subprocess_set_standard_error_to_stdout
g_subprocess_set_standard_error_unix_fd
@@ -3925,7 +3924,6 @@ g_subprocess_set_standard_input_str
g_subprocess_set_standard_input_stream
g_subprocess_set_standard_input_to_devnull
g_subprocess_set_standard_input_unix_fd
-g_subprocess_set_standard_output_file_path
g_subprocess_set_standard_output_to_devnull
g_subprocess_set_standard_output_unix_fd
g_subprocess_set_working_directory
diff --git a/gio/gio.symbols b/gio/gio.symbols
index 31fa26c..64b4050 100644
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@ -1099,7 +1099,6 @@ g_subprocess_setenv
g_subprocess_set_io_priority
g_subprocess_set_leave_descriptors_open
g_subprocess_set_use_search_path
-g_subprocess_set_standard_error_file_path
g_subprocess_set_standard_error_to_devnull
g_subprocess_set_standard_error_to_stdout
g_subprocess_set_standard_error_unix_fd
@@ -1109,7 +1108,6 @@ g_subprocess_set_standard_input_str
g_subprocess_set_standard_input_stream
g_subprocess_set_standard_input_to_devnull
g_subprocess_set_standard_input_unix_fd
-g_subprocess_set_standard_output_file_path
g_subprocess_set_standard_output_to_devnull
g_subprocess_set_standard_output_unix_fd
g_subprocess_set_working_directory
diff --git a/gio/gsubprocess.c b/gio/gsubprocess.c
index b6c839e..ab71691 100644
--- a/gio/gsubprocess.c
+++ b/gio/gsubprocess.c
@@ -81,10 +81,8 @@ struct _GSubprocess
gchar *stdin_path;
GInputStream *stdin_stream;
- gchar *stdout_path;
gint stdout_fd;
gint internal_stdout_fd;
- gchar *stderr_path;
gint stderr_fd;
gint internal_stderr_fd;
@@ -934,7 +932,7 @@ g_subprocess_set_standard_input_str (GSubprocess *self,
*
* Calling this function overrides any previous calls, as well as
* other related functions such as
- * g_subprocess_set_standard_output_file_path().
+ * g_subprocess_set_standard_output_unix_fd().
*
* It is invalid to call this function after g_subprocess_start() has
* been called.
@@ -948,8 +946,6 @@ g_subprocess_set_standard_output_to_devnull (GSubprocess *self,
g_return_if_fail (G_IS_SUBPROCESS (self));
g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
- g_free (self->stdout_path);
- self->stdout_path = NULL;
self->stdout_to_devnull = FALSE;
self->stdout_fd = -1;
@@ -957,44 +953,6 @@ g_subprocess_set_standard_output_to_devnull (GSubprocess *self,
}
/**
- * g_subprocess_set_standard_output_file_path:
- * @self: a #GSubprocess
- * @file_path: String containing path to file to use as standard input
- *
- * This function allows providing a file as standard output for the
- * given subprocess. The file will not be opened until
- * g_subprocess_start() has been called.
- *
- * <note>
- * The output file will be opened with similar semantics to
- * g_file_append_to(); on Unix, open(path, O_CREAT, 0644).
- * </note>
- *
- * Calling this function overrides any previous calls, as well as
- * other related functions such as
- * g_subprocess_set_standard_output_to_devnull().
- *
- * It is invalid to call this function after g_subprocess_start() has
- * been called.
- *
- * Since: 2.34
- */
-void
-g_subprocess_set_standard_output_file_path (GSubprocess *self,
- const gchar *file_path)
-{
- g_return_if_fail (G_IS_SUBPROCESS (self));
- g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
-
- g_free (self->stdout_path);
- self->stdout_path = NULL;
- self->stdout_to_devnull = FALSE;
- self->stdout_fd = -1;
-
- self->stdout_path = g_strdup (file_path);
-}
-
-/**
* g_subprocess_set_standard_output_unix_fd:
* @self: a #GSubprocess
* @fd: File descriptor
@@ -1019,8 +977,6 @@ g_subprocess_set_standard_output_unix_fd (GSubprocess *self,
g_return_if_fail (G_IS_SUBPROCESS (self));
g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
- g_free (self->stdout_path);
- self->stdout_path = NULL;
self->stdout_to_devnull = FALSE;
self->stdout_fd = -1;
@@ -1039,7 +995,7 @@ g_subprocess_set_standard_output_unix_fd (GSubprocess *self,
*
* Calling this function overrides any previous calls, as well as
* other related functions such as
- * g_subprocess_set_standard_error_file_path().
+ * g_subprocess_set_standard_error_to_stdout().
*
* It is invalid to call this function after g_subprocess_start() has
* been called.
@@ -1053,7 +1009,6 @@ g_subprocess_set_standard_error_to_devnull (GSubprocess *self,
g_return_if_fail (G_IS_SUBPROCESS (self));
g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
- g_clear_pointer (&self->stderr_path, NULL);
self->stderr_to_devnull = FALSE;
self->stderr_to_stdout = FALSE;
self->stderr_fd = -1;
@@ -1076,7 +1031,7 @@ g_subprocess_set_standard_error_to_devnull (GSubprocess *self,
*
* Calling this function overrides any previous calls, as well as
* other related functions such as
- * g_subprocess_set_standard_error_file_path().
+ * g_subprocess_set_standard_error_to_devnull().
*
* It is invalid to call this function after g_subprocess_start() has
* been called.
@@ -1090,7 +1045,6 @@ g_subprocess_set_standard_error_to_stdout (GSubprocess *self,
g_return_if_fail (G_IS_SUBPROCESS (self));
g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
- g_clear_pointer (&self->stderr_path, NULL);
self->stderr_to_devnull = FALSE;
self->stderr_to_stdout = FALSE;
self->stderr_fd = -1;
@@ -1100,39 +1054,6 @@ g_subprocess_set_standard_error_to_stdout (GSubprocess *self,
}
/**
- * g_subprocess_set_standard_error_file_path:
- * @self: a #GSubprocess
- * @file_path: String containing path to file to use as standard input
- *
- * This function allows providing a file as standard error for the
- * given subprocess. The file will not be opened until
- * g_subprocess_start() has been called.
- *
- * Calling this function overrides any previous calls, as well as
- * other related functions such as
- * g_subprocess_set_standard_error_to_devnull().
- *
- * It is invalid to call this function after g_subprocess_start() has
- * been called.
- *
- * Since: 2.34
- */
-void
-g_subprocess_set_standard_error_file_path (GSubprocess *self,
- const gchar *file_path)
-{
- g_return_if_fail (G_IS_SUBPROCESS (self));
- g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
-
- g_clear_pointer (&self->stderr_path, NULL);
- self->stderr_to_devnull = FALSE;
- self->stderr_to_stdout = FALSE;
- self->stderr_fd = -1;
-
- self->stderr_path = g_strdup (file_path);
-}
-
-/**
* g_subprocess_set_standard_error_unix_fd:
* @self: a #GSubprocess
* @fd: File descriptor
@@ -1142,7 +1063,7 @@ g_subprocess_set_standard_error_file_path (GSubprocess *self,
*
* Calling this function overrides any previous calls, as well as
* other related functions such as
- * g_subprocess_set_standard_error_file_path().
+ * g_subprocess_set_standard_error_to_devnull().
*
* It is invalid to call this function after g_subprocess_start() has
* been called.
@@ -1156,7 +1077,6 @@ g_subprocess_set_standard_error_unix_fd (GSubprocess *self,
g_return_if_fail (G_IS_SUBPROCESS (self));
g_return_if_fail (self->state == G_SUBPROCESS_STATE_BUILDING);
- g_clear_pointer (&self->stderr_path, NULL);
self->stderr_to_devnull = FALSE;
self->stderr_to_stdout = FALSE;
self->stderr_fd = -1;
@@ -1403,12 +1323,10 @@ g_subprocess_start_with_pipes (GSubprocess *self,
FALSE);
if (out_stdout_stream)
g_return_val_if_fail (self->stdout_fd == -1
- && self->stdout_path == NULL
&& self->stdout_to_devnull == FALSE,
FALSE);
if (out_stderr_stream)
g_return_val_if_fail (self->stderr_fd == -1
- && self->stderr_path == NULL
&& self->stderr_to_devnull == FALSE
&& self->stderr_to_stdout == FALSE,
FALSE);
@@ -1428,30 +1346,6 @@ g_subprocess_start_with_pipes (GSubprocess *self,
g_free (self->stdin_path);
self->stdin_path = NULL;
}
- if (self->stdout_path)
- {
- self->internal_stdout_fd = g_open (self->stdout_path, O_CREAT | O_APPEND | O_WRONLY,
- 0666);
- if (self->stdout_fd < 0)
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
- _("Failed to open file '%s'"), self->stdout_path);
- goto out;
- }
- g_clear_pointer (&self->stdout_path, NULL);
- }
- if (self->stderr_path)
- {
- self->internal_stderr_fd = g_open (self->stderr_path, O_CREAT | O_APPEND | O_WRONLY,
- 0666);
- if (self->stderr_fd < 0)
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
- _("Failed to open file '%s'"), self->stdout_path);
- goto out;
- }
- g_clear_pointer (&self->stderr_path, NULL);
- }
#else
if (self->stdin_path)
{
@@ -1465,23 +1359,9 @@ g_subprocess_start_with_pipes (GSubprocess *self,
g_free (self->stdin_path);
self->stdin_path = NULL;
}
- if (self->stdout_path)
- {
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "FIXME not supported yet");
- goto out;
- }
- if (self->stderr_path)
- {
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "FIXME not supported yet");
- goto out;
- }
#endif
- g_assert (self->stdin_path == NULL
- && self->stdout_path == NULL
- && self->stderr_path == NULL);
+ g_assert (self->stdin_path == NULL);
if (self->child_argv0)
{
diff --git a/gio/gsubprocess.h b/gio/gsubprocess.h
index f542a95..72200e0 100644
--- a/gio/gsubprocess.h
+++ b/gio/gsubprocess.h
@@ -143,10 +143,6 @@ GLIB_AVAILABLE_IN_2_34
void g_subprocess_set_standard_output_to_devnull (GSubprocess *self,
gboolean to_devnull);
-GLIB_AVAILABLE_IN_2_34
-void g_subprocess_set_standard_output_file_path (GSubprocess *self,
- const gchar *file_path);
-
#ifdef G_OS_UNIX
GLIB_AVAILABLE_IN_2_34
void g_subprocess_set_standard_output_unix_fd (GSubprocess *self,
@@ -161,10 +157,6 @@ GLIB_AVAILABLE_IN_2_34
void g_subprocess_set_standard_error_to_stdout (GSubprocess *self,
gboolean to_stdout);
-GLIB_AVAILABLE_IN_2_34
-void g_subprocess_set_standard_error_file_path (GSubprocess *self,
- const gchar *file_path);
-
#ifdef G_OS_UNIX
void g_subprocess_set_standard_error_unix_fd (GSubprocess *self,
gint fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]