From df4e0f2f0e63296cab20bc5682c62965c4348543 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Tue, 6 Dec 2011 09:27:31 -0500 Subject: [PATCH] die if write to output file fails for any reason. --- hierarchy-comparison | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hierarchy-comparison b/hierarchy-comparison index d3039f1..ab44c28 100755 --- a/hierarchy-comparison +++ b/hierarchy-comparison @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # hierarchy-comparison -*- Perl -*- # Possible bug: only -type f and -type d are checked -# Copyright (C) 2001, 2002, 2003, 2004, 2008 Bradley M. Kuhn +# Copyright (C) 2001, 2002, 2003, 2004, 2008, 2011 Bradley M. Kuhn # Copyright (C) 2011 Denver Gingerich # # This software's license gives you freedom; you can copy, convey, @@ -63,6 +63,8 @@ sub FindAndSortOutput { print FILE_OUTPUT "$file\n"; } close FILE_OUTPUT; + die "unable to write to output file: $output: $! ($?)" + if $? != 0 and defined $output; return @sortedChompedFiles; }