]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Ensure that even `autoscan --version' fails when e.g.,
authorJim Meyering <meyering@lucent.com>
Sun, 11 Feb 2001 16:38:44 +0000 (16:38 +0000)
committerJim Meyering <meyering@lucent.com>
Sun, 11 Feb 2001 16:38:44 +0000 (16:38 +0000)
writing to a full disk.

(END): New function.

autoscan.in
autoscan.pl
bin/autoscan.in

index 137e882916297eedfeef09a15a13ae3e854a2459..cc80401f32d4e4fa84b94e0784dadd8c5dc17fea 100644 (file)
@@ -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.
index 137e882916297eedfeef09a15a13ae3e854a2459..cc80401f32d4e4fa84b94e0784dadd8c5dc17fea 100644 (file)
@@ -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.
index 137e882916297eedfeef09a15a13ae3e854a2459..cc80401f32d4e4fa84b94e0784dadd8c5dc17fea 100644 (file)
@@ -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.