aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiping Ke <liping.ke@intel.com>2010-06-18 11:50:44 +0800
committerLiping Ke <liping.ke@intel.com>2010-06-28 13:36:58 +0800
commit391b1ca4a73b49f53911ab5da29e0abc331628f1 (patch)
tree0c4aca1966dc40088b2868bc88fcc65d801abe24
parentdc1436f85bda8aad734b379e0aad9128ab4e8321 (diff)
downloadanjuta-poky-391b1ca4a73b49f53911ab5da29e0abc331628f1.tar.gz
anjuta-poky-391b1ca4a73b49f53911ab5da29e0abc331628f1.tar.bz2
anjuta-poky-391b1ca4a73b49f53911ab5da29e0abc331628f1.zip
Use return value to judge whether terminal command runs successfully or not.
Currently Anjuta IDE vte plugin did not use error output param to show (anjuta_terminal_execute_command) excection errors. Actually it use return value(child_pid) to indicate the command execution result. If fails, -1 will be returned. Otherwise, child process id will be returned. After this fix, this vte terminal plugin still has other issues, please refer to poky sdk bugzilla, bug number: 2000 Signed-off-by: Liping Ke <liping.ke@intel.com>
-rw-r--r--src/plugin.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 216e134..2cc6e25 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -699,6 +699,7 @@ do_local_gdb (AnjutaPluginSdk *sp)
{
gchar *script_name = NULL;
gint fd = 0;
+ gint child_pid;
gchar *script_contents = NULL;
GIOChannel *channel = NULL;
GIOStatus status;
@@ -760,9 +761,16 @@ do_local_gdb (AnjutaPluginSdk *sp)
cmd = g_strdup_printf (LOCAL_GDB_COMMAND, sp->triplet,
script_name, sp->gdb_local_path);
cur_dir = g_get_current_dir ();
- ianjuta_terminal_execute_command (terminal, cur_dir, cmd, NULL, &error);
-
- if (error != NULL)
+ child_pid = ianjuta_terminal_execute_command (terminal, cur_dir, cmd,
+ NULL, &error);
+ /* Currently child_pid < 0 indicate that the command execution fails, error
+ * data is not filled properly. error handling code is not removed since
+ * in future this error structure might be filled. Keep for forward
+ * compatibility
+ */
+ if (child_pid < 0)
+ g_warning("Error happned while launching local gdb command\n");
+ else if (error != NULL)
{
g_warning ("Error whilst launching local gdb command: %s", error->message);
g_clear_error (&error);