From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8379 invoked by alias); 10 May 2005 12:05:20 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 8087 invoked from network); 10 May 2005 12:05:10 -0000 Received: from unknown (HELO iv.iv.ro) (194.105.28.94) by sourceware.org with SMTP; 10 May 2005 12:05:10 -0000 Received: from silvester (silvester.iv.ro [192.168.1.2] (may be forged)) by iv.iv.ro (8.13.0/8.13.0) with ESMTP id j4AC594j005488; Tue, 10 May 2005 15:05:09 +0300 (EEST) From: Gratian Crisan To: Savin Zlobec Date: Tue, 10 May 2005 13:00:00 -0000 User-Agent: KMail/1.8 Cc: ecos-discuss@ecos.sourceware.org References: <200505091228.04579.nelu@iv.ro> <200505101258.48354.nelu@iv.ro> <428091CE.20300@elatec.si> In-Reply-To: <428091CE.20300@elatec.si> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505101500.19717.nelu@iv.ro> Subject: Re: [ECOS] fatfs lseek EOF bug X-SW-Source: 2005-05/txt/msg00143.txt.bz2 On Tuesday 10 May 2005 13:49, Savin Zlobec wrote: > > [snip] > > > See the file attached. The test is for an MMC driver but should be pretty > >straight forward to adapt (only the mount command should be changed). > >The test creates a file and writes blocks of data into it while printing > > the current file offset. In a new file after writing the first block, for > > which the value returned is 0, the value returned by lseek function is > > -1. The strange thing is that if you overwrite an existing file the lseek > > function correctly returns the current file offset (equal to EOF). > > Found the BUG -- Please try the attached patch and let me know if it works. > > savin The patch works OK :), thanks. On a side note: I'm looking for an alternative implementation for 'ftruncate' POSIX function which is missing from eCos. Do you know how I could implement it for fatfs? -nelu -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss