[tz] [PROPOSED PATCH 3/3] zic: check more consistently for I/O errors and improve diagnostics
dirkjan at ochtman.nl
Tue Aug 19 08:32:26 UTC 2014
On Tue, Aug 19, 2014 at 8:27 AM, Paul Eggert <eggert at cs.ucla.edu> wrote:
> * zic.c (warnings): New static var.
> (warning): Set it here.
> (size_product, growalloc, main): Translate diagnostic.
> (verror): Don't increment errors here.
> (error): Set it here.
> (close_file): New function.
> (usage, dolink, infile, writezone): Use it.
> (usage): Fit diagnostic in output lines better.
> (main): Prefer 'return X;' to 'exit(X);'.
> (main, infile, mkdirs): Use 'warning' for warnings.
> Check for stderr output error.
> (dolink, mkdirs): Don't assume gettext preserves errno.
IMO, this would be much better as a number of separate patches:
- Translate diagnostic
- Replace exit() with return
- Extract close_file function and (possibly separately) start using it
- Start using warning() for warnings
- Introduce warnings variable and start using it
Etc, separation of concerns over commits. This makes it much easier to review.
More information about the tz