# output current progress indicator
my $last_p = 0;
+print STDERR "## show_progress: $show_progress ##\n"; # XXX
sub progress {
- # XXX return if ($show_progress ne "");
+ return if (! $show_progress);
my $current = shift;
my $total = shift || 1;
my $p = int($current * 100 / $total);
$import2cp = Text::Iconv->new($config->{isis_codepage},$codepage);
my $db = OpenIsis::open( $isis_db );
+ # OpenIsis::ERR_BADF
+ if ($db == -4) {
+ print STDERR "FATAL: OpenIsis can't find file $isis_db\n";
+ next;
+ # OpenIsis::ERR_IO
+ } elsif ($db == -5) {
+ print STDERR "FATAL: OpenIsis can't access file $isis_db\n";
+ next;
+ } elsif ($db < 0) {
+ print STDERR "FATAL: OpenIsis unknown error $db with file $isis_db\n";
+ next;
+ }
+
my $max_rowid = OpenIsis::maxRowid( $db );
print STDERR "Reading database: $isis_db [$max_rowid rows]\n";