[syslinux] [PATCH] tftp-hpa: add error check for disk filled up

H. Peter Anvin hpa at zytor.com
Tue Sep 3 06:09:22 PDT 2013


On 09/03/2013 12:02 AM, Rongqing Li wrote:
> 
> 
> On 08/29/2013 03:13 AM, H. Peter Anvin wrote:
>> On 08/21/2013 06:00 PM, rongqing.li at windriver.com wrote:
>>> From: "Roy.Li" <rongqing.li at windriver.com>
>>>
>>> Add error check when the write-buffer is finally flushed to the file,
>>> the caller can detect if the disk filled up (or had an i/o error) and
>>> return a NOSAPCE nak to the other side.
>>>
>>> Signed-off-by: Ming Liu <ming.liu at windriver.com>
>>> Signed-off-by: Roy.Li <rongqing.li at windriver.com>
>>
>> Don't mix stdio and raw I/O this way.
>>
>> The right thing to do is either to use fflush() and ferror() to detect
>> an error condition, or consistently use raw I/O.  I would prefer the
>> former.
>>
>>     -hpa
>>
> 
> Could we check putc return value directly?
> 

Well, with buffered I/O we do have to do deferred checking for the error
condition.  We don't have to do that until we write the final block though.

	-hpa




More information about the Syslinux mailing list