]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
* chdir back to original dir on fuse shutdown, for benefit of gmon.out
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 26 Apr 2007 14:50:24 +0000 (14:50 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 26 Apr 2007 14:50:24 +0000 (14:50 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1347 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/fakefuse.cc

index ed2e90a8d5625212719803c10fefb883eabcec87..a9f98e9d5bb08e30b8eb52e7ba8abbd364402677 100644 (file)
@@ -123,7 +123,11 @@ int main(int argc, char **argv) {
     // use my argc, argv (make sure you pass a mount point!)
     cout << "starting fuse on pid " << getpid() << endl;
     client[i]->mount();
+
+    char *oldcwd = get_current_dir_name();  // note previous wd
     ceph_fuse_main(client[i], argc, argv);
+    ::chdir(oldcwd);                        // return to previous wd
+
     client[i]->unmount();
     cout << "fuse finished on pid " << getpid() << endl;
     client[i]->shutdown();