X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b0db36b1ac7a93c147888aa98f9431e8bcc7d36e..1fcbfcb8ba78224fd0e4d532d4fa976f0ea00fef:/apt-pkg/contrib/fileutl.cc diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index a28dce6c0..bc1681820 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: fileutl.cc,v 1.23 1999/03/16 00:43:55 jgg Exp $ +// $Id: fileutl.cc,v 1.26 1999/03/21 07:24:14 jgg Exp $ /* ###################################################################### File Utilities @@ -45,7 +45,7 @@ bool CopyFile(FileFd &From,FileFd &To) if (Size > 64000) ToRead = 64000; - if (To.Read(Buf,ToRead) == false || + if (From.Read(Buf,ToRead) == false || To.Write(Buf,ToRead) == false) { delete [] Buf; @@ -83,6 +83,11 @@ int GetLock(string File,bool Errors) fl.l_len = 0; if (fcntl(FD,F_SETLK,&fl) == -1) { + if (errno == ENOLCK) + { + _error->Warning("Not using locking for nfs mounted lock file %s",File.c_str()); + return true; + } if (Errors == true) _error->Errno("open","Could not get lock %s",File.c_str()); close(FD);