changeset 556:017b1108305b

2004-9-17 Brian Masney <masneyb@gftp.org> * src/gtk/transfer.c (check_done_process) - make sure the return code from the process is reported correctly to the user * docs/gftp-faq.sgml - added section about troubleshooting files not being uploaded * src/gtk/gtkui.c - fixed compiler warning
author masneyb
date Sat, 18 Sep 2004 00:42:01 +0000
parents 7f54d0c0edbc
children 9ed464683676
files ChangeLog docs/gftp-faq.sgml src/gtk/gtkui.c src/gtk/transfer.c
diffstat 4 files changed, 43 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Sep 17 23:37:47 2004 +0000
+++ b/ChangeLog	Sat Sep 18 00:42:01 2004 +0000
@@ -1,4 +1,12 @@
 2004-9-17 Brian Masney <masneyb@gftp.org>
+	* src/gtk/transfer.c (check_done_process) - make sure the return code
+	from the process is reported correctly to the user
+
+	* docs/gftp-faq.sgml - added section about troubleshooting files not
+	being uploaded
+
+	* src/gtk/gtkui.c - fixed compiler warning
+
 	* lib/misc.c lib/cache.c lib/config_file.c lib/gftp.h lib/protocols.c
 	lib/rfc2068.c lib/sshv2.c src/gtk/bookmarks.c src/gtk/dnd.c
 	src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/menu-items.c
@@ -2829,7 +2837,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.322 2004/09/17 23:37:46 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.323 2004/09/18 00:42:01 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/docs/gftp-faq.sgml	Fri Sep 17 23:37:47 2004 +0000
+++ b/docs/gftp-faq.sgml	Sat Sep 18 00:42:01 2004 +0000
@@ -6,7 +6,7 @@
 <book>
 
 <bookinfo>
-  <date>$Date: 2004/09/14 10:24:01 $</date>
+  <date>$Date: 2004/09/18 00:42:01 $</date>
   <title>gFTP FAQ</title>
   <authorgroup>
     <author>
@@ -278,6 +278,20 @@
 
 <!-- ----------------------------------------------------------------- -->
 
+<sect1>
+<title>When using an external editor, gFTP does not detect changes that are being made to the file.</title>
+
+<para>
+Look at the man page for the editor you are using and see if there is a
+command line argument to have the editor run in the foreground (it won't
+fork to detact from the current terminal). If you are using one of the
+graphical VIM editors, you can add the --nofork argument.
+</para>
+
+</sect1>
+
+<!-- ----------------------------------------------------------------- -->
+
 </chapter>
 
 <!-- ***************************************************************** -->
--- a/src/gtk/gtkui.c	Fri Sep 17 23:37:47 2004 +0000
+++ b/src/gtk/gtkui.c	Sat Sep 18 00:42:01 2004 +0000
@@ -385,10 +385,10 @@
   char *tempstr;
   int ret;
 
+  wdata = uidata;
   if ((tempstr = gftp_expand_path (wdata->request, directory)) == NULL)
     return (FALSE);	  
   
-  wdata = uidata;
   cdata = g_malloc0 (sizeof (*cdata));
   cdata->request = wdata->request;
   cdata->uidata = wdata;
--- a/src/gtk/transfer.c	Fri Sep 17 23:37:47 2004 +0000
+++ b/src/gtk/transfer.c	Sat Sep 18 00:42:01 2004 +0000
@@ -324,8 +324,8 @@
 {
   gftp_viewedit_data * ve_proc;
   GList * curdata, *deldata;
+  int ret, procret;
   struct stat st;
-  int ret;
   char *str;
   pid_t pid;
 
@@ -342,17 +342,27 @@
 	    {
 	      viewedit_processes = g_list_remove_link (viewedit_processes, 
                                                        deldata);
-	      if (ret != 0)
-		ftp_log (gftp_logging_error, NULL,
-			 _("Error: Child %d returned %d\n"), pid, ret);
-	      else
-		ftp_log (gftp_logging_misc, NULL,
-			 _("Child %d returned successfully\n"), pid);
+              if (WIFEXITED (ret))
+                {
+                  procret = WEXITSTATUS (ret);
+                  if (procret != 0)
+                    ftp_log (gftp_logging_error, NULL,
+                             _("Error: Child %d returned %d\n"), pid, procret);
+                  else
+                    ftp_log (gftp_logging_misc, NULL,
+                             _("Child %d returned successfully\n"), pid);
+                }
+              else
+                ftp_log (gftp_logging_error, NULL,
+                         _("Error: Child %d did not terminate properly\n"),
+                         pid);
 
 	      if (!ve_proc->view && !ve_proc->dontupload)
 		{
 		  /* We was editing the file. Upload it */
-		  if (stat (ve_proc->filename, &st) == -1)
+		  ret = stat (ve_proc->filename, &st);
+
+                  if (ret == -1)
 		    ftp_log (gftp_logging_error, NULL,
 		         _("Error: Cannot get information about file %s: %s\n"),
 			 ve_proc->filename, g_strerror (errno));