/[fuse_dbi]/trunk/DBI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/DBI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by dpavlin, Sun Aug 29 18:51:29 2004 UTC revision 12 by dpavlin, Sun Aug 29 19:16:01 2004 UTC
# Line 76  sub mount { Line 76  sub mount {
76          carp "mount needs 'dsn' to connect to (e.g. dsn => 'DBI:Pg:dbname=test')" unless ($arg->{'dsn'});          carp "mount needs 'dsn' to connect to (e.g. dsn => 'DBI:Pg:dbname=test')" unless ($arg->{'dsn'});
77          carp "mount needs 'mount' as mountpoint" unless ($arg->{'mount'});          carp "mount needs 'mount' as mountpoint" unless ($arg->{'mount'});
78    
79            # save (some) arguments in self
80            $self->{$_} = $arg->{$_} foreach (qw(mount));
81    
82          foreach (qw(filenames read update)) {          foreach (qw(filenames read update)) {
83                  carp "mount needs '$_' SQL" unless ($arg->{$_});                  carp "mount needs '$_' SQL" unless ($arg->{$_});
84          }          }
# Line 112  sub mount { Line 115  sub mount {
115                  );                  );
116          } );          } );
117    
118            confess "Fuse::main failed" if (! $self->{'proc'}->poll);
119    
120          $self ? return $self : return undef;          $self ? return $self : return undef;
121  };  };
122    
# Line 130  sub umount { Line 135  sub umount {
135          my $self = shift;          my $self = shift;
136    
137          confess "no process running?" unless ($self->{'proc'});          confess "no process running?" unless ($self->{'proc'});
138          $self->{'proc'}->kill;  
139            system "fusermount -u ".$self->{'mount'} || croak "umount error: $!";
140    
141            if ($self->{'proc'}->poll) {
142                    $self->{'proc'}->kill;
143                    return 1 if (! $self->{'proc'}->poll);
144            } else {
145                    return 1;
146            }
147  }  }
148    
149    

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26