bug-gnulib
[Top][All Lists]
Advanced

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

Re: copy_file_preserving variant that doesn't exit on error?


From: Bruno Haible
Subject: Re: copy_file_preserving variant that doesn't exit on error?
Date: Wed, 11 Jan 2012 02:32:07 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Hi Reuben,

> >> Is there no way to deal with error messages normally, i.e. via
> >> gnulib's strerror? Then the error-returning copy_file_preserving could
> >> replace the aborting version, and users who want to could check the
> >> return code and issue errors in the usual way.
> >
> > This would be a regression on the quality of the messages. There is no
> > errno code for "cannot open backup file for writing".
> 
> That's why I said "gnulib's strerror": by using a gnulib function it's
> possible to add new error messages.

errno describes _what_ error occurred. The error message also contains
information about _when_ it occurred. That is, a situation indicator.
But strerror takes only 1 argument, not 2.

> >    (Remember that assert() is eliminated if NDEBUG is not defined.)
> 
> Surely you mean "if NDEBUG is defined"? Although why would one be
> running the tests with NDEBUG defined?

Sure, yes, I meant the negation. It is not under gnulib's control whether
NDEBUG is defined or not. The user who installs a package can do
   ./configure CPPFLAGS="-DNDEBUG"

> Thanks very much for the review. New patch attached.

Thank you. I'll merge it after my additional refactorings have been reviewed.

Bruno




reply via email to

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