Просмотр исходного кода

without a filename we can't stat pipes

EDSP code uses pipes opened via an FD as sources and later for those
files modification times and filesize are read - but never really used
again. The result we get from FileFd is probably wrong, but as we don't
use it anyway, we just don't fallback if we have nothing to fallback to

Git-Dch: Ignore
David Kalnischkies лет назад: 12
Родитель
Сommit
003c40d373
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      apt-pkg/contrib/fileutl.cc

+ 2 - 1
apt-pkg/contrib/fileutl.cc

@@ -1798,7 +1798,8 @@ static bool StatFileFd(char const * const msg, int const iFd, std::string const
 	 // higher-level code will generate more meaningful messages,
 	 // even translated this would be meaningless for users
 	 return _error->Errno("fstat", "Unable to determine %s for fd %i", msg, iFd);
-      ispipe = S_ISFIFO(Buf.st_mode);
+      if (FileName.empty() == false)
+	 ispipe = S_ISFIFO(Buf.st_mode);
    }
 
    // for compressor pipes st_size is undefined and at 'best' zero