[PATCH] extfs - do not enter broken archive



When user entered archive and there was some problem with listing
archive contents (exit 1 in script) - user saw error and then empty
archive contents. After this patch he sees error, but is not moved
inside broken archive.

BTW when he tries to enter once more, this fix doesn't works - thanks
to vfs cache. Is the vfs cache really needed for local extfs
filesystems? For ftp or fish it's great, but local extfs' are quite
fast indeed...

Regards

-- 

  _.|._ |_  _.    : Adam Byrtek, alpha@(irc.pl|debian.org)
 (_|||_)| |(_|    : gg 1802819, pgp 0xB25952C0
     |            : jid alpha.jabberpl.org
Index: extfs.c
===================================================================
RCS file: /cvs/gnome/mc/vfs/extfs.c,v
retrieving revision 1.63
diff -u -r1.63 extfs.c
--- extfs.c	7 Dec 2002 02:37:58 -0000	1.63
+++ extfs.c	7 Dec 2002 14:16:18 -0000
@@ -392,7 +392,15 @@
 		g_free (current_link_name);
 	}
     }
-    pclose (extfsd);
+
+   /* extfs 'list' didn't return 0 */
+   if (pclose(extfsd)!=0) {
+       /* FIXME: Should clean everything one day */
+       g_free (buffer);
+       close_error_pipe (1,
+			 _("Error reading archive"));
+       return -1;
+    }
     close_error_pipe (1, NULL);
 #ifdef SCO_FLAVOR
     waitpid (-1, NULL, WNOHANG);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]