bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dd skip bug?


From: Pádraig Brady
Subject: Re: dd skip bug?
Date: Thu, 15 Jan 2009 23:04:33 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Pádraig Brady wrote:
> Jim Meyering wrote:
>> Pádraig Brady <address@hidden> wrote:
>>
>>> I spent a little more time on this issue.
>>> The attached patch makes the following changes for seekable inputs and 
>>> outputs.
>>> Note skip is for input, and seek is for output in the following:
>>>
>>> skip beyond end of file
>>>   before: immediately exit(0);
>>>   after : immediately printf("cannot skip: Invalid argument); exit(0);
>>>
>>> skip > device size
>>>   before: read whole device and exit(0);
>>>   after : immediately printf("cannot skip: Invalid argument); exit(1);
>>> seek > device size
>>>   before: read whole device and printf("write error: ENOSPC"); exit(1);
>>>   after : immediately printf("cannot seek: Invalid argument); exit(1);
>>>
>>> skip > max file size
>>>   before: read whole file and exit(0);
>>>   after : immediately printf("cannot skip: Invalid argument); exit(1);
>>> seek > max file size
>>>   before: immediately printf("truncate error: EFBIG"); exit(1);
>>>   after : immediately printf("truncate error: EFBIG"); exit(1);
>>>
>>> skip > OFF_T_MAX
>>>   before: read whole device/file and exit(0);
>>>   after : immediately printf("cannot skip:"); exit(1);
>>> seek > OFF_T_MAX
>>>   before: immediately printf("truncate error: offset too large"); exit(1);
>>>   after : immediately printf("truncate error: offset too large"); exit(1);
>>>
>>>
>>> If the above is desired then I'll add tests before checking in.
>> Those look like good changes.
>> Thanks!
> 
> 
> The proposed patch is attached.
> 
> thanks,
> Pádraig.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Bug-coreutils mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-coreutils





reply via email to

[Prev in Thread] Current Thread [Next in Thread]