summaryrefslogtreecommitdiff
path: root/build-aux/useless-if-before-free
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-02-11 08:34:27 +0100
committerJim Meyering <meyering@redhat.com>2008-02-11 08:34:30 +0100
commit57edc5b234e0bad585bb16efa01cbad309741e38 (patch)
tree9e1fb580aeae15b7b63fb39b76cafbe157f89aa1 /build-aux/useless-if-before-free
parent521cc7336cc22a35a3e7c991539d7cbdc3a8ef79 (diff)
downloadgnulib-57edc5b234e0bad585bb16efa01cbad309741e38.tar.gz
useless-if-before-free: Close stdout carefully.
Diffstat (limited to 'build-aux/useless-if-before-free')
-rwxr-xr-xbuild-aux/useless-if-before-free10
1 files changed, 9 insertions, 1 deletions
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 1cf4cb03f6..a50db667b0 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -2,7 +2,7 @@
# Detect instances of "if (p) free (p);".
# Likewise for "if (p != NULL) free (p);". And with braces.
-my $VERSION = '2008-02-10 22:17'; # UTC
+my $VERSION = '2008-02-11 07:32'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
@@ -31,6 +31,14 @@ use Getopt::Long;
(my $ME = $0) =~ s|.*/||;
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
+
sub usage ($)
{
my ($exit_code) = @_;