From 8437ce241dda9004cd87b0d46ce6e7ff197fc927 Mon Sep 17 00:00:00 2001 From: joeyh Date: Sat, 2 Feb 2008 21:42:22 +0000 Subject: [PATCH] * vidir: Check exit codes of close. Closes: #463739 --- debian/changelog | 6 ++++++ vidir | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9c0437e..bbf4131 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +moreutils (0.27) UNRELEASED; urgency=low + + * vidir: Check exit codes of close. Closes: #463739 + + -- Joey Hess Sat, 02 Feb 2008 16:41:52 -0500 + moreutils (0.26) unstable; urgency=low * isutf8: Correct inverted exit code when passed a file to check. diff --git a/vidir b/vidir index ebc946d..3798da7 100755 --- a/vidir +++ b/vidir @@ -92,7 +92,7 @@ foreach my $item (@ARGV) { } my $tmp=File::Temp->new(TEMPLATE => "dirXXXXX", DIR => File::Spec->tmpdir); -open (OUT, ">".$tmp->filename) || die "$0: cannot write ".$tmp->filename.": $!\n"; +open (OUT, ">".$tmp->filename) || die "$0: cannot create ".$tmp->filename.": $!\n"; my %item; my $c=0; @@ -102,7 +102,7 @@ foreach (@dir) { print OUT "$c\t$_\n"; } @dir=(); -close OUT; +close OUT || die "$0: cannot write ".$tmp->filename.": $!\n"; my @editor="vi"; if (-x "/usr/bin/editor") { @@ -171,7 +171,7 @@ while () { die "$0: unable to parse line \"$_\", aborting\n"; } } -close IN; +close IN || die "$0: cannot read ".$tmp->filename.": $!\n"; unlink($tmp.'~') if -e $tmp.'~'; foreach my $item (sort values %item) { -- 2.39.5