]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cfuse: bail out on mount() errors
authorSage Weil <sage@newdream.net>
Wed, 26 May 2010 17:01:49 +0000 (10:01 -0700)
committerSage Weil <sage@newdream.net>
Wed, 26 May 2010 17:59:38 +0000 (10:59 -0700)
src/cfuse.cc

index a0aeff8f9c72c2cef86f7ccb3966684cea800814..eb7d5611cea1001c2fc826aef21df60274f8b3e2 100644 (file)
@@ -75,12 +75,16 @@ int main(int argc, const char **argv, const char *envp[]) {
 
   messenger->start();
 
+  int r;
+
   // start client
   client->init();
     
   // start up fuse
   // use my argc, argv (make sure you pass a mount point!)
-  client->mount();
+  r = client->mount();
+  if (r < 0)
+    goto out_shutdown;
 
   _dout_create_courtesy_output_symlink("client", client->get_nodeid().v);
   cout << "starting fuse" << std::endl;
@@ -95,13 +99,14 @@ int main(int argc, const char **argv, const char *envp[]) {
   cout << "fuse finished, unmounting ceph" << std::endl;
   client->unmount();
   cout << "unmounted" << std::endl;
+
+ out_shutdown:
   client->shutdown();
-  
   delete client;
   
   // wait for messenger to finish
   messenger->wait();
   
-  return 0;
+  return r;
 }