$ctime_start = time();
+ my $pid;
if ($arg->{'fork'}) {
- my $pid = fork();
+ $pid = fork();
die "fork() failed: $!" unless defined $pid;
# child will return to caller
if ($pid) {
- $self ? return $self : return undef;
+ return $self;
}
}
$self->read_filenames;
- my $mount = Fuse::main(
+ Fuse::main(
mountpoint=>$arg->{'mount'},
getattr=>\&e_getattr,
getdir=>\&e_getdir,
debug=>0,
);
- if (! $mount) {
- warn "mount on ",$arg->{'mount'}," failed!\n";
- return undef;
- }
+ exit(0) if ($arg->{'fork'});
+
+ return 1;
+
};
=head2 umount
eval "use DBD::SQLite";
plan skip_all => "DBD::SQLite required for testing" if $@;
-plan tests => 14;
+plan tests => 15;
use_ok('DBI');
use_ok('Fuse::DBI');
ok($sth->execute($file,$data), "insert $file");
}
+ok($dbh->disconnect, "disconnect after insert");
+
my $sql_filenames = qq{
select
name as id,
update => $sql_update,
dsn => $dsn,
mount => $mount,
+ fork => 1,
});
ok($mnt, "mount");
update => $sql_update,
dsn => $dsn,
mount => $mount,
+ fork => 1,
});
ok($mnt, "mount");