vte r2107 - in trunk: . src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: vte r2107 - in trunk: . src
- Date: Mon, 6 Oct 2008 20:11:55 +0000 (UTC)
Author: chpe
Date: Mon Oct 6 20:11:55 2008
New Revision: 2107
URL: http://svn.gnome.org/viewvc/vte?rev=2107&view=rev
Log:
Add vte_terminal_get_child_exit_status() so we can get the child's exit status from withint the child-exited signal handlers. Bug #509204.
Modified:
trunk/ChangeLog
trunk/src/vte-private.h
trunk/src/vte.c
trunk/src/vte.h
Modified: trunk/src/vte-private.h
==============================================================================
--- trunk/src/vte-private.h (original)
+++ trunk/src/vte-private.h Mon Oct 6 20:11:55 2008
@@ -207,6 +207,7 @@
gboolean pty_input_active;
GPid pty_pid; /* pid of child using pty slave */
VteReaper *pty_reaper;
+ int child_exit_status;
/* Input data queues. */
const char *encoding; /* the pty's encoding */
Modified: trunk/src/vte.c
==============================================================================
--- trunk/src/vte.c (original)
+++ trunk/src/vte.c Mon Oct 6 20:11:55 2008
@@ -3134,6 +3134,7 @@
_vte_buffer_clear(terminal->pvt->outgoing);
/* Tell observers what's happened. */
+ terminal->pvt->child_exit_status = status;
vte_terminal_emit_child_exited(terminal);
}
}
@@ -3247,6 +3248,8 @@
terminal->pvt->pty_master = -1;
}
+ terminal->pvt->child_exit_status = 0;
+
/* Open the new pty. */
pid = -1;
fd = _vte_pty_open(&pid, env_add, command, argv, directory,
@@ -7798,6 +7801,7 @@
pvt->pty_input_source = VTE_INVALID_SOURCE;
pvt->pty_output_source = VTE_INVALID_SOURCE;
pvt->pty_pid = -1;
+ pvt->child_exit_status = 0;
/* Initialize the screens and histories. */
vte_terminal_reset_rowdata(&pvt->alternate_screen.row_data,
@@ -12482,6 +12486,28 @@
_vte_terminal_connect_pty_read (terminal);
}
+/**
+ * vte_terminal_get_child_exit_status:
+ * @terminal: a #VteTerminal
+ *
+ * Gets the exit status of the command started by vte_terminal_fork_command().
+ * See your C library's documentation for more details on how to interpret the
+ * exit status.
+ *
+ * Note that this function may only be called from the signal handler of
+ * the "child-exited" signal.
+ *
+ * Returns: the child's exit status
+ *
+ * Since: 0.17.5
+ */
+int
+vte_terminal_get_child_exit_status(VteTerminal *terminal)
+{
+ g_return_val_if_fail(VTE_IS_TERMINAL(terminal), -1);
+ return terminal->pvt->child_exit_status;
+}
+
/* We need this bit of glue to ensure that accessible objects will always
* get signals. */
void
Modified: trunk/src/vte.h
==============================================================================
--- trunk/src/vte.h (original)
+++ trunk/src/vte.h Mon Oct 6 20:11:55 2008
@@ -428,6 +428,8 @@
const char *vte_terminal_get_window_title(VteTerminal *terminal);
const char *vte_terminal_get_icon_title(VteTerminal *terminal);
+int vte_terminal_get_child_exit_status(VteTerminal *terminal);
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]