Package: apt
Version: 0.6.38
Severity: normal
Tags: patch

Hi,

On GNU/kFreeBSD, apt fails a with a FATAL error when trying to fetch a
file that doesn't exists on a server. That wasn't really a problem for
apt 0.5.x, but apt 0.6.x try to download Release.gpg file that dont
exist on all server, thus making apt unusable on that port.

The problem is that apt try to remove the non blocking flag from
/dev/null, and the FreeBSD kernel doesn't allow that (well, it doesn't
make really sense to remove that flag on that device).

Please find attached a patch to fix that. It would be nice if it could
be in included the next upload.

Thanks in advance,
Aurelien

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i586)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.3-16
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages apt depends on:
ii  libc0.1                    2.3-1+kbsd.10 GNU C Library: Shared libraries an
ii  libgcc1                    1:4.0.0-12    GCC support library
ii  libstdc++6                 4.0.0-12      The GNU Standard C++ Library v3

apt recommends no packages.

-- no debconf information
diff -Nur apt-0.6.38/methods/http.cc apt-0.6.38+kbsd/methods/http.cc
--- apt-0.6.38/methods/http.cc	2005-05-24 23:33:10.000000000 +0200
+++ apt-0.6.38+kbsd/methods/http.cc	2005-07-10 23:56:06.000000000 +0200
@@ -787,7 +787,8 @@
 {
    if (File != 0)
    {
-      SetNonBlock(File->Fd(),false);
+      if (File->Name().compare("/dev/null"))
+         SetNonBlock(File->Fd(),false);
       if (Srv->In.WriteSpace() == false)
 	 return true;
       
@@ -815,7 +816,8 @@
    // Dump the buffer to the file
    if (Srv->State == ServerState::Data)
    {
-      SetNonBlock(File->Fd(),false);
+      if (File->Name().compare("/dev/null"))
+         SetNonBlock(File->Fd(),false);
       while (Srv->In.WriteSpace() == true)
       {
 	 if (Srv->In.Write(File->Fd()) == false)

Reply via email to