DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51EDFWqm1562727 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 51EDFWqm1562727 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=Gspr3yId X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA8B23858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1739538931; bh=rHeXifWEN3x4QWeImWNeRpFMO6+PMbjAfIlna68ODrM=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Gspr3yIdMCN47LA20NLLyHpW1ZuC2MxFSWRKPhNbWoy7PmeLzlRU4QiDOgqnybXhu DrtsJj1v7asQTK96k3l5hbizs89SVJeSJz9nGiKHAnFvj7WACSxJZcDs3nQDBMoGQW 4JgvCgnp8UQJhLQK5LEbtZx9aCjV2/A0/SJiQCEE= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 944433858C2B Date: Fri, 14 Feb 2025 14:14:40 +0100 To: cygwin AT cygwin DOT com Subject: Re: SEEK_DATA should fail at EOF (was: coreutils-9.6-1 (TEST): cp: infinite SEEK_SET/DATA/HOLE loop if file is compressed) Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <614771e9-592c-6154-d56d-13842b6fc6ac AT t-online DOT de> <5ccdf4be-4e4b-1846-9fd6-cba29c9dbb11 AT t-online DOT de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Feb 14 13:49, Corinna Vinschen via Cygwin wrote: > On Feb 14 12:24, Christian Franke via Cygwin wrote: > > Hmm... does "beyond" mean '>=' or '>' ? > > ...do you think this fixes it? > > diff --git a/winsup/cygwin/fhandler/base.cc b/winsup/cygwin/fhandler/base.cc > index 8f3dbd4ed51a..79dfaaa5987a 100644 > --- a/winsup/cygwin/fhandler/base.cc > +++ b/winsup/cygwin/fhandler/base.cc > @@ -1144,7 +1144,7 @@ fhandler_base::lseek (off_t offset, int whence) > return -1; > } > /* Per Linux man page, ENXIO if offset is beyond EOF */ > - if (offset > fsi.EndOfFile.QuadPart) > + if (offset >= fsi.EndOfFile.QuadPart) > { > set_errno (ENXIO); > return -1; Yeah, it does. I'll push the patch. Corinna -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple