GNU bug report logs -
#13391
dd silently ignores lseek error
Previous Next
Full log
Message #19 received at 13391 <at> debbugs.gnu.org (full text, mbox):
Hi,
On Wed, Jan 09, 2013 at 01:14:22AM +0000, Pádraig Brady wrote:
> On 01/08/2013 08:55 PM, Paul Eggert wrote:
>> On 01/08/13 10:11, Neil Klopfenstein wrote:
>>> Note that it begins reading at the _beginning of the ar file_ -- the 'skip'
>>> argument has failed silently.
>>
>> But the 'skip' hasn't failed. It's merely being implemented via 'read'
>> rather than via 'lseek'. The records are being skipped correctly.
>>
>> It might be useful to give dd a new option, which causes it
>> to insist on lseeking rather than reading in cases like these,
>> and to report an error if the lseek fails.
>
> I had a look around for a tool to verify
> that a file/device supports the seek operation
> and couldn't find one.
> So this seems like useful functionality.
> Worth applying the attached?
> [...]
>
> * src/dd.c: Add the new O_SEEKABLE flag.
> (main): Verify leek() works if O_SEEKABLE is set.
^^^^^^lseek()
> [...]
> /* else file_size && offset > OFF_T_MAX or file ! seekable */
>
> +
Stray new newline?
> do
> [...]
Besides these nitpicks the patch looks good to me.
HTH,
Erik
This bug report was last modified 12 years and 132 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.