[Pkg-mc-commits] r89 - trunk/debian/patches
winnie at alioth.debian.org
winnie at alioth.debian.org
Wed Feb 27 15:50:23 UTC 2008
Author: winnie
Date: 2008-02-27 15:50:22 +0000 (Wed, 27 Feb 2008)
New Revision: 89
Added:
trunk/debian/patches/62_dont_hang_on_errors.patch
Log:
New try to fix this issue
Added: trunk/debian/patches/62_dont_hang_on_errors.patch
===================================================================
--- trunk/debian/patches/62_dont_hang_on_errors.patch (rev 0)
+++ trunk/debian/patches/62_dont_hang_on_errors.patch 2008-02-27 15:50:22 UTC (rev 89)
@@ -0,0 +1,47 @@
+--- mc-4.6.2~pre1/vfs/fish.c 2007/09/25 15:33:38 1.121
++++ mc-4.6.2~pre1/vfs/fish.c 2007/10/26 13:46:42 1.123
+@@ -619,25 +619,39 @@
+ g_free (name);
+ name = quoted_name;
+ fh->u.fish.append = 0;
++
++ /*
++ * Check whether the remote file is readable by using `dd' to copy
++ * a single byte from the remote file to /dev/null. If `dd' completes
++ * with exit status of 0 use `cat' to send the file contents to the
++ * standard output (i.e. over the network).
++ */
+ offset = fish_command (me, FH_SUPER, WANT_STRING,
+ "#RETR /%s\n"
++ "if dd if=/%s of=/dev/null bs=1 count=1 2>/dev/null ;\n"
++ "then\n"
+ "ls -ln /%s 2>/dev/null | (\n"
+ "read p l u g s r\n"
+ "echo \"$s\"\n"
+ ")\n"
+ "echo '### 100'\n"
+ "cat /%s\n"
+- "echo '### 200'\n",
+- name, name, name );
++ "echo '### 200'\n"
++ "else\n"
++ "echo '### 500'\n"
++ "fi\n",
++ name, name, name, name );
+ g_free (name);
+ if (offset != PRELIM) ERRNOR (E_REMOTE, 0);
+ fh->linear = LS_LINEAR_OPEN;
+ fh->u.fish.got = 0;
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 || (defined _LARGE_FILES && _LARGE_FILES)
+- if (sscanf( reply_str, "%llu", &fh->u.fish.total )!=1)
++ errno = 0;
++#if SIZEOF_OFF_T == SIZEOF_LONG
++ fh->u.fish.total = strtol (reply_str, NULL, 10);
+ #else
+- if (sscanf( reply_str, "%u", &fh->u.fish.total )!=1)
++ fh->u.fish.total = strtoll (reply_str, NULL, 10);
+ #endif
++ if (errno != 0)
+ ERRNOR (E_REMOTE, 0);
+ return 1;
+ }
More information about the Pkg-mc-commits
mailing list