bug-coreutils
[Top][All Lists]
Advanced

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

bug#11058: Completion of error handling


From: Eric Blake
Subject: bug#11058: Completion of error handling
Date: Wed, 21 Mar 2012 16:13:34 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

tag 11058 notabug
thanks

On 03/21/2012 03:50 PM, Markus Elfring wrote:
> Hello!
> 
> I have looked at a few source files for your current software. I have
> noticed that some checks for return codes are missing.

Thanks for the report.

> 
> Would you like to add more error handling for return values from
> functions like the following?
> - atexit ⇒ main
> 
> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/date.c?id=3ba8b044267a5f7cfa8a7b0d7f19dab3f21431da#n320

Maybe worth cleaning up all atexit() calls, but unlikely to ever fail
since POSIX guarantees at least 32 successful atexit calls and we are
only making 1.  I'm not losing any sleep if we don't change this.

> 
> - fputs ⇒ print_numbers
> 
> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/seq.c?id=d3227eeb90c8308abd1e6bf08ee253b7a4e78d1d#n238
> 
> 
> - printf ⇒ write_header
> 
> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/head.c?id=d7878454cd02518959b0d6036db3a5b6ff00ca57#n162

Intentional.  We have chosen to instead install an atexit handler as
well as use the gnulib module close-stream, which guarantees that we
investigate ferror() for all closed FILE*, and deal with the errors in a
central location rather than bloating the code to deal with errors after
every single operation on a FILE*.  Not worth your time to try to patch
these.

You can still submit patches, and we will still evaluate them on their
individual merits, but I don't see this as fixing any actual bugs at the
moment, so I'm marking this bug as closed.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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