From: Jim Meyering Date: Sun, 11 Feb 2001 16:38:44 +0000 (+0000) Subject: Ensure that even `autoscan --version' fails when e.g., X-Git-Tag: autoconf-2.50~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e1011933f6edcccbf185090842c9c0654ee672f;p=thirdparty%2Fautoconf.git Ensure that even `autoscan --version' fails when e.g., writing to a full disk. (END): New function. --- diff --git a/autoscan.in b/autoscan.in index 137e88291..cc80401f3 100644 --- a/autoscan.in +++ b/autoscan.in @@ -53,6 +53,17 @@ my %generic_macro = my $configure_scan = 'configure.scan'; + +# Exit nonzero whenever closing STDOUT fails. +sub END +{ + use POSIX qw (_exit); + # This is required if the code might send any output to stdout + # E.g., even --version or --help. So it's best to do it unconditionally. + close STDOUT + or (warn "$me: closing standard output: $!\n"), _exit (1); +} + # find_autoconf # ------------- # Find the lib files and autoconf. diff --git a/autoscan.pl b/autoscan.pl index 137e88291..cc80401f3 100644 --- a/autoscan.pl +++ b/autoscan.pl @@ -53,6 +53,17 @@ my %generic_macro = my $configure_scan = 'configure.scan'; + +# Exit nonzero whenever closing STDOUT fails. +sub END +{ + use POSIX qw (_exit); + # This is required if the code might send any output to stdout + # E.g., even --version or --help. So it's best to do it unconditionally. + close STDOUT + or (warn "$me: closing standard output: $!\n"), _exit (1); +} + # find_autoconf # ------------- # Find the lib files and autoconf. diff --git a/bin/autoscan.in b/bin/autoscan.in index 137e88291..cc80401f3 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -53,6 +53,17 @@ my %generic_macro = my $configure_scan = 'configure.scan'; + +# Exit nonzero whenever closing STDOUT fails. +sub END +{ + use POSIX qw (_exit); + # This is required if the code might send any output to stdout + # E.g., even --version or --help. So it's best to do it unconditionally. + close STDOUT + or (warn "$me: closing standard output: $!\n"), _exit (1); +} + # find_autoconf # ------------- # Find the lib files and autoconf.