[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Diagnose write errors in config.status
From: |
Jim Meyering |
Subject: |
Re: Diagnose write errors in config.status |
Date: |
Thu, 15 Nov 2007 23:54:05 +0100 |
Ralf Wildenhues <address@hidden> wrote:
> Plowing my way through Bruno's bug reports and suggestions from:
> <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/11571/focus=11850>.
> Let's make write errors fail config.status.
>
> First off, writing a test that exercises all possible code paths is
> rather difficult. I left it at a reasonably primitive addition to an
> existing test, where most of the write errors will just trigger at the
> `mkdir "$tmp"' near the beginning. And a couple of tests using
> /dev/full which I guess is not portable; however, on systems without it,
> the redirection will just fail, so we should at least degrade gracefully.
>
> I just went through status.m4 once, searching for all failure spots.
> I deliberately left out checking all the
> cat >$CONFIG_STATUS <<...
>
> for now, my (weak) rationale being that with a write error, the
> config.status file will likely be completely unusable anyway (and my
> other one being laziness for now). Do you think each one of them should
> be checked as well? I can try fixing that then.
>
> I believe to have found all other spots, but would of course appreciate
> a second pair of eyes.
>
> OK to apply?
Hi Ralf,
Thanks for doing this.
To make it slightly more portable, ...
...
> @@ -838,17 +840,22 @@ m4_define([_AC_OUTPUT_HEADER],
> # CONFIG_HEADER
> #
> if test x"$ac_file" != x-; then
> - AS_ECHO(["/* $configure_input */"]) >"$tmp/config.h"
> - $AWK -f "$tmp/defines.awk" $ac_file_inputs >>"$tmp/config.h"
> + {
> + AS_ECHO(["/* $configure_input */"]) \
> + && $AWK -f "$tmp/defines.awk" $ac_file_inputs
> + } >"$tmp/config.h" \
> + || AC_MSG_ERROR([could not create $ac_file])
shouldn't that be s/{/:;{/, above?
Re: Diagnose write errors in config.status, Bruno Haible, 2007/11/15