summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-01-19 14:49:18 +0000
committerfukachan <fukachan>2001-01-19 14:49:18 +0000
commit6bcc5c7b1aae5298c64d5fe33338d6988681ecf4 (patch)
tree3a97db976daff4b2c015935ff9471fe0420b61c2 /fml/lib
parent47a5b3930cd6f1a66810299c45a794efb705b3d6 (diff)
downloadfml8-6bcc5c7b1aae5298c64d5fe33338d6988681ecf4.tar.gz
fml8-6bcc5c7b1aae5298c64d5fe33338d6988681ecf4.tar.bz2
fml8-6bcc5c7b1aae5298c64d5fe33338d6988681ecf4.zip
validate file handle more
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/IO/MapAdapter.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/fml/lib/IO/MapAdapter.pm b/fml/lib/IO/MapAdapter.pm
index 658f8623..1be0d988 100644
--- a/fml/lib/IO/MapAdapter.pm
+++ b/fml/lib/IO/MapAdapter.pm
@@ -95,6 +95,7 @@ sub open
}
else {
$self->_log("Error: cannot open $file $flag");
+ return undef;
}
}
elsif ($self->{'_type'} eq 'unix.group') {
@@ -221,7 +222,7 @@ sub getpos
if ($self->{'_type'} eq 'file') {
my $fh = $self->{_fh};
- tell($fh);
+ defined $fh ? tell($fh) : undef;
}
elsif ($self->{'_type'} eq 'unix.group') {
$self->{_counter};
@@ -261,7 +262,7 @@ sub eof
if ($self->{'_type'} eq 'file') {
my $fh = $self->{_fh};
- $fh->eof;
+ $fh->eof if defined $fh;
}
elsif ($self->{'_type'} eq 'unix.group') {
$self->{_counter} > $self->{_num_members} ? 1 : 0;
@@ -280,7 +281,7 @@ sub close
my ($self) = @_;
if ($self->{'_type'} eq 'file') {
- $self->{_fh}->close;
+ $self->{_fh}->close if defined $self->{_fh};
}
elsif ($self->{'_type'} eq 'unix.group') {
;